Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jun 13, 2013 1:54 pm 
Offline
Senior Newbie

Joined: Tue May 03, 2011 8:31 am
Posts: 5
I have an nginx setup with folder structure like this:

Code:
- www
|- splash
|- blog


www is the root folder.

I would like to redirect users who access http://mysite.com to the splash folder.
But I don't want the URL in the address bar to change to http://mysite.com/splash.
The URL in the address bar should still be http://mysite.com.
This rule should only apply when user accesses the root folder.

Meanwhile accessing the blog folder will be as usual via: http://mysite.com/blog.

How do I achieve this? So far my conf is as follow: (they don't work btw)

Code:
location / {
   root /www;
   index index.html;
}

location = / {
   root /www/splash;
   index index.html;
}


Cheers!


Top
   
PostPosted: Mon Jun 17, 2013 2:48 am 
Offline
Senior Member
User avatar

Joined: Thu Feb 16, 2012 9:01 pm
Posts: 52
keep you second config and remove the first.

for blog do a location /blog ... with a root change

look up the meaning of = with location and see if this is really what you want.

also look what alias means in nginx configs.


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