How to... - nginx config to serve static files

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs