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
How to serve an app's static files. #270
Comments
You could also use a custom template or vhost config pointing to a shared volume as you said so that |
If you can use separate VIRTUAl_HOST/domain for static content (say static.example.com):
If you can't use a separate domain
You may consider a regex for a clever location specification. |
Since this issue was never closed.... I was able to serve static files this way
Will the proxy configurations from |
@janekolszak solution is great but could it be done in a more general manner by editing nginx.tmpl and using environment variables ( like STATIC_DOMAIN and STATIC_LOCATION) ? I am not used to go templating language so any help is welcome ;) |
For me, I went on a different route than what I originally commented here. I set up a vanilla nginx container that does the serving then I just set it with the usual env vars, |
Fix forced renewal of certificates
I get that this is the "cleanest" way, but isn't a setup like this quite resource-expensive, since every request for a static file has to pass through two nginx instances? I also found this stackoverflow post where the author suggests to use |
You should probably use Per Virtual-Host Configuration config for this. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Thanks for all the work you have put into this great project. I must be missing something, but how do I serve an app's static files out of the same container. Do I need to create per VHOST config pointing to a shared volume? Is there an easier way that I am not seeing?
The text was updated successfully, but these errors were encountered: