Welcome! Log In Create A New Profile

Advanced

Status page doesn't work

Posted by sorry 
sorry
Status page doesn't work
July 27, 2010 03:40PM
Hi,

I have download and install the new php 5.3.3 (obviously with php-fpm
enable).

This is part of my php-fpm.conf:

[mysite]
; reference = default
user = mysite-www
group = mysite
listen = /var/run/php/mysite.fpm.sock
listen.owner = mysite-www
listen.group = mysite
listen.mode = 0666
pm = dynamic
pm.max_children = 10
pm.start_servers = 5
pm.min_spare_servers = 3
pm.max_spare_servers = 10
pm.max_requests = 3
pm.status_path = /status.php
listen.backlog = 1024
;listen.socket_mode = 0600
ping.path = /ping
ping.response = pong
request_terminate_timeout = 0
request_slowlog_timeout = 0
rlimit_files = 1024
rlimit_core = 0
;chroot = no
catch_workers_output = no

And this is part of my nginx configuration:

server {
include server_default;
server_name mysite.com;

index index.html index.php;
root /home/mysite/public_html;

location ~ \.(php)$ {
try_files $uri 404;
fastcgi_pass unix:/var/run/php/mysite.fpm.sock;
include fastcgi_params_phpfpm;
}
}

It works very well but php-fpm doesn't answer at http://mysite.com/status.php.

Any idea?

Thanks a lot
Re: Status page doesn't work
July 27, 2010 05:25PM
In php-fpm.conf set:
pm.status_path = /status
They even say:
[quote]; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.[/quote]


And add this location in nginx:

[code]
location ~ ^/(status|ping)$ {
try_files $uri 404;
fastcgi_pass unix:/var/run/php/mysite.fpm.sock;
include fastcgi_params_phpfpm;
}
[/code]

http://VladGh.com
sorry
Re: Status page doesn't work
July 28, 2010 04:00AM
Hi,

I followed your instructions but I get the same error:

404 Not Found

This is the fastcgi_params_phpfpm:


fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;

fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;

fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
#fastcgi_param SERVER_NAME $server_name;
fastcgi_param SERVER_NAME $http_host;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;

#fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

fastcgi_param HTTPS $ssl_protocol;
fastcgi_read_timeout 300;

#disable buffering between nginx and fastcgi (fcgi_temp folder) good
for large uploads
fastcgi_max_temp_file_size 0;

fastcgi_ignore_client_abort off;

Any idea?

Thanks
On Jul 27, 11:25 pm, "nofun" <nginx-fo...@nginx.us> wrote:
> In php-fpm.conf set:
> pm.status_path = /status
> They even say:
> [quote]; Note: The value must start with a leading slash (/). The value
> can be
> ;       anything, but it may not be a good idea to use the .php
> extension or it
> ;       may conflict with a real PHP file.[/quote]
>
> And add this location in nginx:
>
> [code]
> location ~ ^/(status|ping)$ {
> try_files $uri 404;
> fastcgi_pass unix:/var/run/php/mysite.fpm.sock;
> include fastcgi_params_phpfpm;}
>
> [/code]
>
> Posted at Nginx Forum:http://forum.nginx.org/read.php?3,113611,113647#msg-113647
Re: Status page doesn't work
July 28, 2010 07:36AM
Try only:

[code]
location ~ ^/(status|ping)$ {
fastcgi_pass unix:/var/run/php/mysite.fpm.sock;
include fastcgi_params_phpfpm;
}
[/code]

And the address should be http://mysite.com/status (without .php).

http://VladGh.com
Re: Status page doesn't work
July 28, 2010 08:29AM
This works for me:

[code]
location = /status {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /status;
fastcgi_pass php;
access_log off;
}
[/code]
sorry
Re: Status page doesn't work
July 28, 2010 08:34AM
Certainly,

I tried with the url:

http://mysite.com/status

but I get the same "404 Not Found"


On Jul 28, 1:36 pm, "nofun" <nginx-fo...@nginx.us> wrote:
> Try only:
>
> [code]
> location ~ ^/(status|ping)$ {
> fastcgi_pass unix:/var/run/php/mysite.fpm.sock;
> include fastcgi_params_phpfpm;}
>
> [/code]
>
> And the address should behttp://mysite.com/status(without .php).
>
> Posted at Nginx Forum:http://forum.nginx.org/read.php?3,113611,113803#msg-113803
sorry
Re: Status page doesn't work
July 28, 2010 08:42AM
Ok,

deleting "try_files $uri 404;"

works fine!

Thanks a lot!

Regards



On Jul 28, 1:36 pm, "nofun" <nginx-fo...@nginx.us> wrote:
> Try only:
>
> [code]
> location ~ ^/(status|ping)$ {
> fastcgi_pass unix:/var/run/php/mysite.fpm.sock;
> include fastcgi_params_phpfpm;}
>
> [/code]
>
> And the address should behttp://mysite.com/status(without .php).
>
> Posted at Nginx Forum:http://forum.nginx.org/read.php?3,113611,113803#msg-113803
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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