Forum: NGINX How to... - nginx config to serve static files

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nginx Forum (Guest)
on 2009-03-14 07:29
(Received via mailing list)
From "nginx config to serve static files" at

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
This topic is locked and can not be replied to.