一、现象
二、解决方式
http {
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;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 4096;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 8071;
server_name 101.42.104.247;
location / {
root /home/intelligent_evaluation_of_rock_burst/development_project/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html; //加上这个就不会了,具体原理待研究
}
#动态请求
location /api{
include uwsgi_params;
uwsgi_pass 127.0.0.1:5000;
}
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
nginx -s reload 重新加载nginx
nginx -t 测试nginx是否正常