Hello,
a half year ago i changed the webserver from apache to nginx - at all it is much faster but its not working 100% perfect.
I get randomly following error:
2015/09/14 15:12:58 [error] 805300#763696: *35245 upstream timed out (10060: FormatMessage() error:(15105)) while reading response header from upstream, client: 192.168.0.23, server: _, request: "GET /Servicehelp6/user/25/dashboard.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "192.168.0.180:8080", referrer: "http://192.168.0.180:8080/Servicehelp6/user/25/dashboard.php"
exactly the same command/action works one second later. - the php script itself takes about 2-3seconds to run/load
heres my configuration:
nginx.conf:
#####################################
worker_processes 1;
error_log "B:/Servicehelp/logs/Nginx/error.log";
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
access_log "B:/Servicehelp/logs/Nginx/access.log";
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
server {
#SiteName Servicehelp
listen *:8080;
server_name _;
root "B:/Servicehelp/htdocs";
error_log "B:/Servicehelp/logs/Nginx/Servicehelp-error.log";
autoindex on;
index index.php index.html index.htm;
#charset koi8-r;
#access_log "B:/Servicehelp/logs/Nginx/Servicehelp-access.log";
location / {
index index.php index.html index.htm;
}
location ~ (^/phpmyadmin|^/sql\x20buddy|^/memcache|^/memadmin|^/phpredisadmin|^/webgrind|^/eaccelerator|^/rockmongo)/.+\.php$ {
allow 127.0.0.1;
deny all;
root "B:/Servicehelp/htdocs";
error_log "B:/Servicehelp/logs/Nginx/Servicehelp-error.log";
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ (^/phpmyadmin|^/sql\x20buddy|^/memcache|^/memadmin|^/phpredisadmin|^/webgrind|^/eaccelerator|^/rockmongo) {
allow 127.0.0.1;
deny all;
root "B:/Servicehelp/htdocs";
error_log "B:/Servicehelp/logs/Nginx/Servicehelp-error.log";
autoindex on;
}
error_page 500 502 503 504 /e404.html;
location = /e404.html {
root "B:/Servicehelp/htdocs/errhandler";
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri $uri/ @rewrites =404;
fastcgi_pass 127.0.0.1:9001;
#fastcgi_pass php_farm;
fastcgi_index index.php;
include fastcgi_params;
# This line prevents the filename from getting jumbled
#fastcgi_param DOCUMENT_URI /forum;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME localhost;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
}
#####################################
fastcgi.conf:
#####################################
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;
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 HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
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;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
#####################################
nginx_serv.ini.
#####################################
[Nginx Serv]
;php-cgi.exe maximum number of processes, Value: 0 (default)
maxProcess=1
;php-cgi.exe dynamic loading, Value: 0 (PHP debug or Performance)
dynamicLoading=0
phpFPM_enable=0
rotatelogs_enable=1
[Generate for Nginx Serv]
php-cgi.exe_path=php-5.3.29-nts-Win32-VC9-x86\php-cgi.exe
php-cgi.exe_arg=-b 127.0.0.1:9001
listen_addr=127.0.0.1:9001
nginx_logs=B:\Servicehelp\logs\Nginx\error.log|B:\Servicehelp\logs\Nginx\access.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log
#####################################
I really really hope that someone can help me.... I have no idea what is causing this issue and its getting annoying (specially when a form is submitted)
Best regards,
David
a half year ago i changed the webserver from apache to nginx - at all it is much faster but its not working 100% perfect.
I get randomly following error:
2015/09/14 15:12:58 [error] 805300#763696: *35245 upstream timed out (10060: FormatMessage() error:(15105)) while reading response header from upstream, client: 192.168.0.23, server: _, request: "GET /Servicehelp6/user/25/dashboard.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9001", host: "192.168.0.180:8080", referrer: "http://192.168.0.180:8080/Servicehelp6/user/25/dashboard.php"
exactly the same command/action works one second later. - the php script itself takes about 2-3seconds to run/load
heres my configuration:
nginx.conf:
#####################################
worker_processes 1;
error_log "B:/Servicehelp/logs/Nginx/error.log";
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
access_log "B:/Servicehelp/logs/Nginx/access.log";
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
server {
#SiteName Servicehelp
listen *:8080;
server_name _;
root "B:/Servicehelp/htdocs";
error_log "B:/Servicehelp/logs/Nginx/Servicehelp-error.log";
autoindex on;
index index.php index.html index.htm;
#charset koi8-r;
#access_log "B:/Servicehelp/logs/Nginx/Servicehelp-access.log";
location / {
index index.php index.html index.htm;
}
location ~ (^/phpmyadmin|^/sql\x20buddy|^/memcache|^/memadmin|^/phpredisadmin|^/webgrind|^/eaccelerator|^/rockmongo)/.+\.php$ {
allow 127.0.0.1;
deny all;
root "B:/Servicehelp/htdocs";
error_log "B:/Servicehelp/logs/Nginx/Servicehelp-error.log";
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ (^/phpmyadmin|^/sql\x20buddy|^/memcache|^/memadmin|^/phpredisadmin|^/webgrind|^/eaccelerator|^/rockmongo) {
allow 127.0.0.1;
deny all;
root "B:/Servicehelp/htdocs";
error_log "B:/Servicehelp/logs/Nginx/Servicehelp-error.log";
autoindex on;
}
error_page 500 502 503 504 /e404.html;
location = /e404.html {
root "B:/Servicehelp/htdocs/errhandler";
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri $uri/ @rewrites =404;
fastcgi_pass 127.0.0.1:9001;
#fastcgi_pass php_farm;
fastcgi_index index.php;
include fastcgi_params;
# This line prevents the filename from getting jumbled
#fastcgi_param DOCUMENT_URI /forum;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME localhost;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
}
#####################################
fastcgi.conf:
#####################################
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;
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 HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
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;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
#####################################
nginx_serv.ini.
#####################################
[Nginx Serv]
;php-cgi.exe maximum number of processes, Value: 0 (default)
maxProcess=1
;php-cgi.exe dynamic loading, Value: 0 (PHP debug or Performance)
dynamicLoading=0
phpFPM_enable=0
rotatelogs_enable=1
[Generate for Nginx Serv]
php-cgi.exe_path=php-5.3.29-nts-Win32-VC9-x86\php-cgi.exe
php-cgi.exe_arg=-b 127.0.0.1:9001
listen_addr=127.0.0.1:9001
nginx_logs=B:\Servicehelp\logs\Nginx\error.log|B:\Servicehelp\logs\Nginx\access.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log|B:\Servicehelp\logs\Nginx\Servicehelp-error.log
#####################################
I really really hope that someone can help me.... I have no idea what is causing this issue and its getting annoying (specially when a form is submitted)
Best regards,
David