Can you migrate a web app available via '/' to a proxied sub-URI without modifying the web app?

itpp2012 nginx-forum at
Tue May 9 09:33:17 UTC 2017

location /flask-demo/ {
         root /var/www/passenger-python-flask-demo;
         proxy_set_header X-Forwarded-Proto $scheme;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Host $host;
         rewrite    /flask-demo/([^/]+) /$1 break;

And then add additional location blocks/rewrites to handle static content.

Posted at Nginx Forum:,274104,274106#msg-274106

More information about the nginx mailing list