Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for nginx proxy with subpath #453

Open
LucaBarco opened this issue Feb 21, 2025 · 0 comments
Open

Support for nginx proxy with subpath #453

LucaBarco opened this issue Feb 21, 2025 · 0 comments

Comments

@LucaBarco
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant