1.頁面展示HTTP 400錯誤
查看nginx.conf中upstream 後面名稱配置是否包含下劃線,有的話需要去掉或者改別的,因爲新版本的nginx不能識別;
2.nginx代理websocket需要特殊的配置
location / {
client_max_body_size 100M;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade; #需要加入
proxy_set_header Connection "upgrade"; #需要加入
proxy_pass api.demoProject.com;
proxy_set_header Origin ""; #如果出現403錯誤,需要加入
}
3.nginx反向代理,跨域配置
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;