Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Mar 14, 2009 1:08 am 
Offline
Senior Newbie

Joined: Sat Mar 14, 2009 1:04 am
Posts: 7
Website: http://nowyoufirst.com
Dear all,

I currently have setupped my nginx to be able to serve static files. The snippets is as such:
Code:
server {
        listen   80;
        server_name  72.14.185.215;

        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 http://72.14.185.215/media , I get a 404 message. I already created the /var/www/media folder. Have I missed on something here?

Thanks in advance


Top
   
 Post subject:
PostPosted: Sat Mar 14, 2009 1:56 pm 
Offline
Senior Member

Joined: Thu Apr 03, 2008 12:02 am
Posts: 103
AOL: derole
did you try switching the two location statements and putting "/media" first ?
chances are the "/" location is used first, it evaluates to
"/var/www/nginx-default" + "media" --> "/var/www/nginx-default/media" (which doesn't exist i assume)
and returns the 404


Top
   
 Post subject:
PostPosted: Sat Mar 14, 2009 8:03 pm 
Offline
Senior Member

Joined: Thu Dec 04, 2008 10:55 am
Posts: 57
Location: New Jersey
It's also redirecting to http://localhost/media/

Just pointing that out. :\


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group