Multiple containers on the same port, or hosting static content on the root nginx proxy? #614
Unanswered
SuperRoach
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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/; }
Beta Was this translation helpful? Give feedback.
All reactions