peppermint
peppermint copied to clipboard
Support for nginx proxy with subpath
Hello, I am trying to deploy Peppermint behind an nginx reverse proxy using a subpath inside an existing domain (e.g., example.com/ticketing) since I cannot create a new specific domain in my infrastructure.
When I access the application through the proxy, the page is blank, and the browser console shows 404 errors for CSS and JavaScript assets.
Specifically:
- The application loads a blank page.
- The browser console reports 404 errors for JavaScript and CSS files, which are requested from
/instead of/ticketing/. - Direct API calls also fail because they do not account for the subpath.
I deployed Peppermint using the last docker-compose.yml file provided in the documentation.
Here is the relevant Nginx configuration I am using:
server {
listen 80;
server_name myserver.com;
location /ticketing/ {
rewrite ^/ticketing(/.*)$ $1 break; # I also tried without this
proxy_pass http://localhost:3000;
proxy_set_header Host $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;
}
location /ticketing/api {
rewrite ^/ticketing(/.*)$ $1 break; # I also tried without this
proxy_pass http://localhost:5003;
proxy_set_header Host $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;
}
}
Questions
- Does Peppermint support being served from a subpath behind a reverse proxy?
- Is there a configuration setting to define the base path (e.g.,
/ticketing) for assets and API calls? - If not, what is the recommended approach to make this setup work with Nginx?
Thank you for your support!