Welcome! Log In Create A New Profile

Advanced

Help needed with config

Ian Hobson
November 04, 2013 12:38PM
Hi,

I'm baffled. What I want to do is to serve static and php files from one
root if they exist there, and
from another if they don't, and give a 404 error if the file is in
neither location. I have the following config file.

server {
server_name reseller.anake.hcs;
listen 80;
fastcgi_read_timeout 300;
index index.php;
set $resellerroot "/home/ian/websites/reseller/htdocs";
set $centralroot "/home/ian/websites/coachmaster3dev/htdocs";
root $resellerroot;
# if / then redirect to index.php
location = / {
# serve /index.php
rewrite ^ /index.php last;
}
# if local php file exits, serve with fcgi
location ~ \.php$ {
try_files $uri $uri/ @masterphp;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param CENTRAL_ROOT $centralroot;
fastcgi_param RESELLER_ROOT $resellerroot;
include /etc/nginx/fastcgi_params;
}
# serve php file from master root
location @masterphp {
root $centralroot;
try_files $uri $uri/ =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $centralroot$fastcgi_script_name;
fastcgi_param CENTRAL_ROOT $centralroot;
fastcgi_param RESELLER_ROOT $resellerroot;
include /etc/nginx/fastcgi_params;
}
# serve local static files if they exist
try_files $uri @masterstatic;
# switch to master set when they don't
location @masterstatic {
root $centralroot;
try_files $uri =404;
}
# now to configure the long polling
push_store_messages on;
location /publish {
push_publisher;
set $push_channel_id $arg_id;
push_message_timeout 30s;
push_max_message_buffer_length 10;
}
# public long-polling endpoint
location /activity {
push_subscriber;
push_subscriber_concurrency broadcast;
set $push_channel_id $arg_id;
default_type text/plain;
}
}

It gives me "No input file specified. " for *all* inputs - and I mean
all. Files in $centralroot,
files in $resellerroot, files in neither, static files, and php files.

Why? What am I doing silly???

I'm using nginx 1.2.6, compiled with the Comet module included.

Thanks

Ian


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

Help needed with config

Ian Hobson November 04, 2013 12:38PM

Re: Help needed with config

Francis Daly November 04, 2013 02:02PM

Re: Help needed with config

Ian Hobson November 04, 2013 02:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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