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

itpp2012 nginx-forum at forum.nginx.org
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;
         proxy_pass http://127.0.0.1:3000/;
     }

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

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,274104,274106#msg-274106



More information about the nginx mailing list