I want the Request URL to be converted from http://host.com/newname/abc?def= to http://newname/abc?def= here is the config file
http://host.com/newname/abc?def=
http://newname/abc?def=
server { listen 80; server_name host.com location / { rewrite ^(.+)/$ $1 permanent; rewrite ^(.+)/index.html$ $1 permanent; rewrite ^(.+).html$ $1 permanent; try_files /$host/public/$uri @webserver; } }
Adding above line worked form me
location / { rewrite ^ $scheme://$request_uri? permanent; }
But it replaces the url in user browser which i donn't want to happen. Any way to achieve it
You can try this:
location /newname{ proxy_pass http://example.com/newname/abc?def=; }
or
location /newname{ proxy_pass http://newname/abc?def=; }
2.1m questions
2.1m answers
60 comments
57.0k users