Hi All,
I am using nginx for routing the incoming requests to web application and resources path. But sometime nginx suddenly stopped working. I could not able to identify the actual root cause.
Following is the nginx conf file and attached error log....
--------------------------------------------------------------------------------
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 150;
#gzip on;
client_max_body_size 200M;
server_names_hash_bucket_size 64;
#include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name localhost max_fails=3;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
proxy_buffering off;
proxy_buffer_size 4k;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 10M;
sendfile on;
send_timeout 300s;
location / {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# 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$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
server {
listen 90;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
location /local/var/www/images {
alias /home/nwook/work/upload/data;
}
}
}
--------------------------------------------------------------------
Please let us know the reason for stopping nginx suddenly..
I am using nginx for routing the incoming requests to web application and resources path. But sometime nginx suddenly stopped working. I could not able to identify the actual root cause.
Following is the nginx conf file and attached error log....
--------------------------------------------------------------------------------
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/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 /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 150;
#gzip on;
client_max_body_size 200M;
server_names_hash_bucket_size 64;
#include /etc/nginx/conf.d/*.conf;
server {
listen 80;
server_name localhost max_fails=3;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
proxy_buffering off;
proxy_buffer_size 4k;
client_body_in_file_only clean;
client_body_buffer_size 32K;
client_max_body_size 10M;
sendfile on;
send_timeout 300s;
location / {
proxy_pass http://localhost:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# 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$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
server {
listen 90;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
location /local/var/www/images {
alias /home/nwook/work/upload/data;
}
}
}
--------------------------------------------------------------------
Please let us know the reason for stopping nginx suddenly..