[FORUM] How to... - nginx config to serve static files

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

[FORUM] How to... - nginx config to serve static files

Nginx Forum

From "nginx config to serve static files" at http://forum.nginx.org/showthread.php?t=11


---Quote (Originally by jpartogi)---
Hi guys.

Thanks for replying. I'm almost there now. Now I can access the directory, but when I access the file I get 404 again, while the file already exists on that directory. Is there anything I need to setup?

Thanks in advance
---End Quote---
Okay done with it. :-) Instead of using the about configuration, I just use wildcards for every static files as stated in the docs as such:

# serve static files
    location ~ ^/(images|javascript|js|css|flash|media|static)/  {
      root    /var/www/virtual/big.server.com/htdocs;
      expires 30d;


Posted by jpartogi