Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Multiple containers on the same port, or hosting static content on the root nginx proxy? #326

Closed
SuperRoach opened this issue Jun 12, 2020 · 0 comments

Comments

@SuperRoach
Copy link

SuperRoach commented Jun 12, 2020

A common method of deploying a python django app is to use something like gunicorn to run the dynamic content, and it will then spit out a of static content (think css and js files) that the client would need.

This would mean you would have a container serving your dynamic content and being proxied through xyz.com great. But how would you host the static content on the same domain, albeit in a different location? (under /static/)?

  • Create a second static container, with a basic nginx config that hosts the local content, on the same VIRTUAL_HOST. When I do this, the nginx proxy is alternating between which container gets the request.

  • Somehow alter the main nginx-proxy to have a location entry in the nginx config, in order to serve the content itself, or point to a docker container if a request is in /static/ .
    That would look some thing like this, next to it's / entry.
    location /static/ { root /some/place/on/nginx-proxy/static/; }

@nginx-proxy nginx-proxy locked and limited conversation to collaborators May 16, 2024
@buchdag buchdag converted this issue into discussion #614 May 16, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant