How can I strip the base url in Nginx for a Mojolicious app? How can I strip the base url in Nginx for a Mojolicious app? nginx nginx

How can I strip the base url in Nginx for a Mojolicious app?


To modify the URI as it passes upstream, you can use a rewrite...break or perform a similar function using the proxy_pass directive itself.

For example:

location /print {    rewrite ^/print(/.*)$ $1 break;    proxy_pass http://printo;    ...}

Remember to keep a leading / in the rewritten URI. See this document for details.Or:

location /print/ {    proxy_pass http://printo/;    ...}

The location value should have a trailing / to ensure that the text substitution occurs correctly. See this document for details.