Welcome! Log In Create A New Profile

Advanced

Help needed with configuration

Ian Hobson
July 18, 2013 05:58AM
Hi All,

I am trying to set up Nginx for a reseller scenario. The reseller will
get his own root, and be able to
create his versions of any file on the site, or, by leaving the file
out, simply have the basic one used
instead. My test configuration is below, and it so nearly works!

The URL reseller.anake.hcs does not result in serving
....coachmaster3dev/htdocs/index.php as I want,
but in a 403 Forbidden error.

server {
server_name reseller.anake.hcs;
listen 80;
fastcgi_read_timeout 300;
index index.php index.html index.htm;
root /home/ian/websites/reseller/htdocs;
# don't serve templates
location ~ \.tpl {
return 404;
}
# handle php
location ~ \.php$ {
try_files $uri $uri/ @masterphp;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location @masterphp {
root /home/ian/websites/coachmaster3dev/htdocs;
try_files $uri $uri/ =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
# try reseller's static files
location / {
try_files $uri $uri/ @master;
}
# switch to master set
location @master {
root /home/ian/websites/coachmaster3dev/htdocs;
try_files $uri $uri/ =404;
}
}

I am using nginx 1.2.6.

How can I get it to work?

Thanks

Ian

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Help needed with configuration

Ian Hobson July 18, 2013 05:58AM

Re: Help needed with configuration

mex July 18, 2013 06:39AM

Re: Help needed with configuration

Ian Hobson July 18, 2013 02:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 193
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