nginx配置伪静态时候弹出nginx: [emerg] unknown "connection_upgrade" variable
1.8k
类别: 
问题反馈

phpstudy---nginx-----网站-------nginx: [emerg] unknown "connection_upgrade" variable

代码信息如下

前端PC端配置

location /
{
try_files $uri /pc/$uri /pc/index.html;
}

前端管理后台配置

location /admin{
try_files $uri $uri/ /admin/index.html;
}

前端Mobile配置

location /mobile{
try_files $uri $uri/ /mobile/index.html;
}

接口配置

location ~ ^/(api|adminapi|im){
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}

移动端静态资源

location /static{
try_files $uri $uri/ /static/index.html;
}

WebSocket配置(多商户版的IM客服系统或Pro版需要用到)

location ^~ /ws {

后台准备的websocket地址端口,非开发者可以不更换,注意开通99端口

proxy_pass http://127.0.0.1:99;

其他参数

proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}

标签:
评论 2
/ 1000
0
2
收藏