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

Nginx Forum forum.nginx.org at gmail.com
Sat Mar 14 08:18:32 MSK 2009

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

Dear all,

I currently have setupped my nginx to be able to serve static files. The snippets is as such:

server {
        listen   80;

        location / {
                root   /var/www/nginx-default;
                index  index.html index.htm;

        location /media {
                root /var/www/media;
#               autoindex on;
#               allow all;
Now when I access from the browser using this address , I get a 404 message. I already created the /var/www/media folder. Have I missed on something here?

Thanks in advance

Posted by jpartogi

More information about the nginx mailing list