Hi all, I have been tinkering around with my nginx conf file to try to get it to serve my static files but it appears from my error.log in nginx that I have set up the path wrongly somehow. Here is the line: open() "/home/rawfish/webapps/nginx//html/favicon.ico" failed (2: No such file or directory), client: 127.0.0.1, server: nginx.rawfish.webfactional.com, request: "GET /favicon.ico HTTP/1.0", host: "nginx.rawfish.webfactional.com" I would like to serve my static files from /home/rawfish/webapps/static/ but I can't seem to point it there. Here is some other information that might help! If you need any other information please tell me :) server { listen 40181; server_name nginx.rawfish.webfactional.com;
And here is my settings.py relevant section:
The main site is working but without any css and images while the subdomain nginx.rawfish.webfactional.com is able to output the "Welcome to Nginx!" message. Thanks for reading! asked 20 Feb '12, 10:02 rawfish |
Hi, The "STATIC_URL" in your configuration is wrong - it should be http://nginx.rawfish.webfactional.com/ instead. Also, the best way to do this would be to serve static files directly through the FrontEnd Nginx server, instead of setting up your own Nginx server. to do that, simply create a static-only web app, point your STATIC_ROOT to it, and mount this app on the subdomain or subpath where you want to serve static files. If you continue experiencing problems setting this up, please open a ticket. answered 20 Feb '12, 10:15 todork 1
Thanks for the reply todork. Indeed that was a typo on my part but it still did not resolve the problem. However, I have taken your advice and gone back to using what I was previously using instead of tinkering around. :) I would uprate your post but I don't have enough rep. Cheers!
(20 Feb '12, 10:46)
rawfish
Hi again, Another possible problem I can see is that you've set it up to be served under /static/, so your URLs would be something like: http://nginx.rawfish.webfactional.com/static/something.html. In any case, using the frontend Nginx server to serve your static files is better.
(20 Feb '12, 10:54)
todork
|