#1  
Old 22nd March 2012, 09:48
itsnedkeren itsnedkeren is offline
Senior Member
 
Join Date: May 2009
Location: Denmark
Posts: 128
Thanks: 32
Thanked 10 Times in 10 Posts
Default NginX redirect fails

Hi all,

Trying to redirect http://domain.tld to http://domain.tld/gallery

ISPConfig setup:
Code:
Redirect type = permanent
Redirect path = http://domain.tld/gallery/
Which generates these lines in the NginX vhost file:

Code:
 if ($http_host ~* "^domain.tld$") {
            rewrite ^/(.+)$ http://domain.tld/gallery/$1 permanent;
        }
		
        if ($http_host ~* "^www.domain.tld$") {
            rewrite ^/(.+)$ http://domain.tld/gallery/$1 permanent;
        }
If an index.html file is present in http://domain.tld, the resulting URL is:

Code:
http://domain.tld/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/gallery/index.html
If NO index.html file is present, I get this error:

Code:
403 forbidden
System info:
Debian 6.0
NginX 1.0.14 (dotdeb)

Please assist, I've tried everything.

Best regards
Jim
__________________
Best regards

Jim

Last edited by itsnedkeren; 22nd March 2012 at 10:30.
Reply With Quote
Sponsored Links
  #2  
Old 23rd March 2012, 13:55
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

I've added this to our bugtracker, so we will check that.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
itsnedkeren (23rd March 2012)
  #3  
Old 20th August 2012, 07:25
jbd123 jbd123 is offline
Junior Member
 
Join Date: Jul 2012
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Default

I came up against this issue as well, none of the redirect options worked in Nginx and for permanent redirects we got the OP issue with the recursive paths.

I added a manual redirect to suit our requirements, which was to redirect a domain to a specific path using a permanent redirect HTTP code.


if ($http_host ~* "^example.com$") {
rewrite ^.+$ http://example.org/target/path permanent;
}

Obviously there are improvements around that using try_files but it works for now.
http://wiki.nginx.org/HttpRewriteModule#if

If I'm reading it correctly, the rewrite ISPC adds would only work if the URL has a trailing slash:

rewrite ^/(.+)$ http://domain.tld/gallery/$1 permanent;



What is the bug # , searched but couldn't find it?

Last edited by jbd123; 20th August 2012 at 07:28.
Reply With Quote
The Following User Says Thank You to jbd123 For This Useful Post:
falko (21st August 2012)
  #4  
Old 21st August 2012, 12:55
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
Default

This has been fixed in SVN already: http://bugtracker.ispconfig.org/inde...rch_name=&type[0]=&sev[0]=&pri[0]=&due[0]=&reported[0]=&cat[0]=&status[0]=&percent[0]=&opened=&dev=&closed=&duedatefrom=&duedateto=&cha ngedfrom=&changedto=&openedfrom=&openedto=&closedf rom=&closedto=
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 23rd August 2012, 02:27
jbd123 jbd123 is offline
Junior Member
 
Join Date: Jul 2012
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Default

Great, thanks, any news on 3.0.5 release date. I have people asking why redirects aren't working so I'd like to give them an ETA.

Thanks

Quote:
Originally Posted by falko View Post
This has been fixed in SVN already: http://bugtracker.ispconfig.org/inde...rch_name=&type[0]=&sev[0]=&pri[0]=&due[0]=&reported[0]=&cat[0]=&status[0]=&percent[0]=&opened=&dev=&closed=&duedatefrom=&duedateto=&cha ngedfrom=&changedto=&openedfrom=&openedto=&closedf rom=&closedto=
Reply With Quote
  #6  
Old 23rd August 2012, 09:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,740 Times in 2,575 Posts
 
Default

There's no release date yet. I'd expect it in October, but there's excessive testing to be done...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
nginx Segmentation fault Error,The Perfect Server - CentOS 6 With nginx [ISPConfig 3] alihan1988 HOWTO-Related Questions 0 2nd February 2012 17:07
A Working Nginx Catchall with ISPConfig 3. renders Tips/Tricks/Mods 4 15th April 2011 21:53
New feature request: Frame redirect funtion for ISPConfig3 Hans Feature Requests 1 12th January 2011 00:43
Nginx and PHP and Fastcgi Paladinemishakal Installation/Configuration 1 4th January 2011 13:45
add new subdomain with redirect type L fails when redirect path is /home/ finn Installation/Configuration 7 22nd August 2010 09:42


All times are GMT +2. The time now is 23:48.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.