我在我的服务器上运行React.js应用程序。它大部分时间都可以工作,但有时候我会随机收到500错误而且我会得到一个白屏(死亡)。调试后,它似乎是一个nginx问题。我的nginx.conf
如下所示,是否有任何错误配置?
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
server_tokens off;
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;
keepalive_timeout 65;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites/*;
index index.html index.htm;
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
access_log /var/log/nginx/access.log main;
location / {
try_files $uri $uri/ /index.html$query_string;
}
location = /favicon.ico {
log_not_found off;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /500.html;
location = /500.html {
}
}
}