Welcome! Log In Create A New Profile

Advanced

"index" directive not working with dynamic server_name

December 14, 2010 06:23AM
Hi,

I recently upgraded to nginx 0.8.53 as it has support for regular expressions in the server_name directive.

However, when using this, the index directive gets ignored and a directory listing is displayed.

I've included part of the file which is causing the problem below. Essentially, when I visit a host matched by the server_name, I get a directory listing. One of the files in the directory is index.php - which is set as one of the "indexes".

Has anyone experienced similar issues to this?

server {
server_name ~^staging-(?P<version>.+)\.(?P<domain>.+)\.com$;
root /var/www/htdocs/site1/staging/$domain-staging-$version/public/;

autoindex on;

error_log /var/log/nginx/site1-staging.error.log info

index index.php index.html index.htm;

# file continues.....
Subject Author Posted

"index" directive not working with dynamic server_name

eckstac December 14, 2010 06:23AM

Re: "index" directive not working with dynamic server_name

Igor Sysoev December 14, 2010 06:56AM

Re: "index" directive not working with dynamic server_name

eckstac December 14, 2010 07:39AM

Re: "index" directive not working with dynamic server_name

eckstac December 15, 2010 05:03PM

Re: "index" directive not working with dynamic server_name

Maxim Dounin December 15, 2010 08:20PM

Re: "index" directive not working with dynamic server_name

eckstac December 16, 2010 04:43AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 267
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready