I want to run the application Mattermost in a subfolderconfiguration like
https://www.example.com/mattermost/
location /mattermost/ {
gzip off;
proxy_set_header X-Forwarded-Ssl on;
client_max_body_size 50M;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://localhost:8065/;
}
With this configuration I'll get passed to the correct application but the application does not recognize the subfolder. It tries to server
https://www.example.com/static/style.css instead of https://www.example.com/mattermost/style.css and brings up a 404 error.
How can I pass also the subfolder to the reverse proxy with nginx?