Welcome! Log In Create A New Profile

Advanced

nginx does not see index.php unless index order is changed.

Posted by talkingnews 
nginx does not see index.php unless index order is changed.
January 20, 2012 05:05AM
I'm using a system called ISPconfig to manage my sites, and then "hand coding" in some redirects afterwards.

The system automates everything in the config up until the
location ~ \.php$ {
block, after which you can add more directives.

I have:

/weather/index.html ... and a few other subdomain roots.

I also have
/subdomainscript/index.php
as a catchall which allows me to wildcard subdomains and base their content on the subdomain.
ie: cheese.mydomain.com might say "Here's some info on cheese".

ISPconfig sets up the following:

index index.html index.htm index.php index.cgi index.pl index.xhtml;

But while weather.mydomain.com works because the index is a plain .html file, any redirects to subdomainscript, which has index.php in its root, doesn't. If I manually add index.php to the end, it works. And if I drop a plain html file, it reads that just fine. But otherwise, it doesn't work.
UNLESS I change the index directive to be:

index index.php index.html index.cgi index.pl index.xhtml;

This is weird, because I thought the idea was that it tried each one in turn? But it seems to not find index.html, then go straight to 404.

Of course, I can change that manually, but each time I make any other change through ISPconfig, it will get reverted, so it's not ideal.

Here's the other relevant part of my config file, if it helps. Am I doing something wrong?


if ($http_host ~* "^weather\.(.*)") {
rewrite ^/(.+)$ /weather/$1 break;
}

if ($http_host ~* "^find\.(.*)") {
rewrite ^/(.+)$ /find/$1 break;
}


if ($http_host ~* "^upload\.(.*)") {
rewrite ^/(.+)$ /tnupload3/$1 break;
}

if ($http_host !~* www\.(.*)|find\.(.*)|upload\.(.*)|weather\.(.*)) {
rewrite ^/(.+)$ /subdomainscript/$1 break;
}
Re: nginx does not see index.php unless index order is changed.
September 17, 2012 06:12AM
BUMP! Same problem with our ISPConfig 3 and nginx. I can access subdomain with index.html only with index.php

Where is problem?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 78
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready