Nginx 配置改不了 TIM截图20190923153207.png(57.68 KB, 下载次数: 0)
24 分钟前 上传
点击文件名下载附件
- location /ws{
- set $flag 0;
- if ($host != ‘xxx.com’) {
- set $flag 1;
- }
- if ($server_port = 80) {
- set $flag 1;
- }
- if ($scheme = http) {
- set $flag 1;
- }
- if ($http_user_agent ~* (baiduspider|soso|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)){
- set $flag 2;
- }
- if ($flag = 1){#正常http请求
- rewrite ^/(.*)$ http://baidu.com/;
- }
- if ($flag = 2){#爬虫
- rewrite ^/(.*)$ http://baidu.com/;
- }
- proxy_pass http://127.0.0.1:10000;#这里输入之前的v2ray端口
- proxy_set_header Host $host:$server_port;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- }
复制代码
重庆网友:test failed代表配置文件有问题啊 测试不通过自然不让你保存了
山西网友:好吧 再研究下