search

Home  >  Q&A  >  body text

nginx mapping problem

I built a 5000 port service a under the server with the domain name xx.com.
I want to do a layer of mapping through nginx
Map http://xx.com/a to xx.com :5000,

nginx conf is written like this

location /a{
    rewrite ^/a/(.*)/ break
    access_log off;
    proxy_pass http://127.0.0.1:5000
}

The current problem is that entering http://xx.com/a/ can be mapped correctly
but http://xx.com/a cannot. Please tell me how to modify it

習慣沉默習慣沉默2753 days ago518

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 17:24:16

    rewrite ^/a(.*)/$1 break

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-16 17:24:16

    Maybe it can be purple

    location /a{
        rewrite ^/a(/|?|#|$)(.*)/ break
        access_log off;
        proxy_pass http://127.0.0.1:5000
    }

    reply
    0
  • Cancelreply