-
Notifications
You must be signed in to change notification settings - Fork 14
How to server the static files with nginx? #4
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
Comments
Because of the dynamic-ish nature of how they're served by the app, I don't believe it's entirely possible without rewriting some of Flask-Themes2. |
I had a look again, because I haven't worked on this in ages and - it turns out that static is served out of
then hitting |
Ah great! I will try this tomorrow :) |
Sorry for my late reply.. I somehow forgot about this 😳 nginx always appends a "/" to the end, although I have removed the last slash from your example. This is how my nginx config looks like now:
btw, you can test it here http://forums.flaskbb.org/_themes/bootstrap3/css/bootstrap.min.css |
After a bit of trail and error I fixed it by myself. my themes location now looks like this:
|
|
I'm pretty a noob in regex.. I got this idea from here and thought what happens If I replace How can I check if those files are really served via nginx? Thanks for taking your time! |
Assuming your nginx install is the same as mine, you'd check wherever your access.log is for your site ( |
I had another look at the nginx wiki and their example is:
So would something like this work, perhaps? I'm really not 100% myself, and don't have an app set up I can test with on my box.
|
That worked! 😄
Thanks! |
No worries. Good to see it worked, I might add that to the README/GitHub Wiki at some point. |
How can I serve the static files with nginx?
The static files for the the theme. Let say I have a theme named bootstrap2, than I would have the following folder structure:
And now, I want that the
main.css
file is served from nginx because he can do that much better than e.g. uWSGI.Is this even possible?
The text was updated successfully, but these errors were encountered: