Welcome! Log In Create A New Profile

Advanced

fastcgi_pass to remote server

Posted by bastardz 
fastcgi_pass to remote server
May 07, 2009 07:40AM
I have two servers with php-fpm nginx. Everything works like a charm on each server.
When I want to set up second servers as remote fastcgi_pass I got No input file specified
Here is my config:

server {
listen 192.168.168.105:80;
server_name localhost;
index index.php;
root /home/ba;
error_log /var/log/nginx/remote.error.log debug;
location / {
error_page 404 = /error.html
}

location ~ \.php$ {
error_log /var/log/nginx/castorama.error.log debug;
fastcgi_pass 192.168.168.3:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
}

Any idea why?
Rauan Maemirov
Re: fastcgi_pass to remote server
May 07, 2009 07:53AM
By default $document_root is /usr/local/nginx/html.

Are u sure, that your scripts is exactly there or did u change it to
proper value?

2009/5/7 bastardz <nginx-forum@nginx.us>:
>
> I have two servers with php-fpm nginx. Everything works like a charm on each server.
> When I want to set up second servers as remote fastcgi_pass I got No input file specified
> Here is my config:
>
> server {
> listen 192.168.168.105:80;
> server_name localhost;
>
Re: fastcgi_pass to remote server
May 07, 2009 08:53AM
The script is exacly there because if I change only one line
fastcgi_pass 192.168.168.3:9000;
into
fastcgi_pass 127.0.0.1:9000;
everything is working as it should.
I've also check php-fpm.conf,
Php-cgi server is listening on 0.0.0.0. I can telnet to 127.0.0.1 and 192.168.168.3
Php-fpm.log on 192.168.168.3 shows no errors
Re: fastcgi_pass to remote server
May 07, 2009 11:58AM
Ha :)
I did know that both server should have index.php in the same location :)
So files structure should be duplicated.
Juan Fco. Giordana
Re: fastcgi_pass to remote server
May 07, 2009 12:25PM
Put your location block inside your server block.

server {
[...]
location ~ \.php$ {
[...]
}
}

bastardz wrote:
> I have two servers with php-fpm nginx. Everything works like a charm on each server.
> When I want to set up second servers as remote fastcgi_pass I got No input file specified
> Here is my config:
>
> server {
> listen 192.168.168.105:80;
> server_name localhost;
> index index.php;
> root /home/ba;
> error_log /var/log/nginx/remote.error.log debug;
> location / {
> error_page 404 = /error.html
> }
>
> location ~ \.php$ {
> error_log /var/log/nginx/castorama.error.log debug;
> fastcgi_pass 192.168.168.3:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> fastcgi_param QUERY_STRING $query_string;
> fastcgi_param REQUEST_METHOD $request_method;
> fastcgi_param CONTENT_TYPE $content_type;
> fastcgi_param CONTENT_LENGTH $content_length;
> }
> }
>
> Any idea why?
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,1848,1848#msg-1848
>
曹宇伟
Re: fastcgi_pass to remote server
May 07, 2009 12:53PM
read the log of php-fpm.

in the php-fpm.conf:

<value name="allowed_clients">127.0.0.1,192.168.168.105</value>,

192.168.168.105 must be the IP address of you nginx host.


On Fri, May 8, 2009 at 12:25 AM, Juan Fco. Giordana <juangiordana@gmail.com> wrote:


Put your location block inside your server block.

server {
[...]
location ~ \.php$ {
[...]
}
}

bastardz wrote:
> I have two servers with php-fpm nginx. Everything works like a charm on each server.
> When I want to set up second servers as remote fastcgi_pass I got No input file specified
> Here is my config:
>
> server {
> listen 192.168.168.105:80;
> server_name localhost;
> index index.php;
> root /home/ba;
> error_log /var/log/nginx/remote.error.log debug;
> location / {
> error_page 404 = /error.html
> }
>
> location ~ \.php$ {
> error_log /var/log/nginx/castorama.error.log debug;
> fastcgi_pass 192.168.168.3:9000;
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
> fastcgi_param QUERY_STRING $query_string;
> fastcgi_param REQUEST_METHOD $request_method;
> fastcgi_param CONTENT_TYPE $content_type;
> fastcgi_param CONTENT_LENGTH $content_length;
> }
> }
>
> Any idea why?
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?3,1848,1848#msg-1848
>




--
==================================
Cao Yuwei
bsdmap.com 

MSN: caoyuwei@hotmail.com
MAIL:caoyuwei@gmail.com
Re: fastcgi_pass to remote server
May 30, 2011 04:26AM
i have same problem. any solution?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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