upstream apache { server 127.0.0.1:8080; } server{ location ~* ^/service/(.*)$ { proxy_pass http://apache/$1; proxy_redirect off; } } >
upstream apache { server 127.0.0.1:8080; } server{ location ~* ^/service/(.*)$ { proxy_pass http://apache/$1; proxy_redirect off; } }
To redirect Without Query String add below lines in Server block under listen port line:
if ($uri ~ .*.containingString$) { return 301 https://$host/$uri/; }
With Query String:
if ($uri ~ .*.containingString$) { return 301 https://$host/$uri/?$query_string; }