【Nginx】错误: [emerg] “proxy_pass“ cannot have URI part in location given by regular expression,...
生活随笔
收集整理的這篇文章主要介紹了
【Nginx】错误: [emerg] “proxy_pass“ cannot have URI part in location given by regular expression,...
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
前言
- nginx 1.15.11(下面的代碼在此版本測(cè)試通過)
- win10
- phpstudy 8.1.1.3
錯(cuò)誤
nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular expression, or inside named location, or inside "if" statement, or inside "limit_except" block in D:\sde\phpstudy_pro\Extensions\Nginx1.15.11/conf/vhosts/com.3jcf.school-test.conf:53錯(cuò)誤寫法
location ~* ^/index.html {if ($query_string ~ ".*(?:^|\?|&)method=autoGenerateIndex(?:(?:&.*)|$)") {proxy_pass http://127.0.0.1:1011/;break;} }正確寫法
location ~* ^/index.html {if ($query_string ~ ".*(?:^|\?|&)method=autoGenerateIndex(?:(?:&.*)|$)") {proxy_pass http://127.0.0.1:1011;break;} }將proxy_pass http://127.0.0.1:1011/; 改為 proxy_pass http://127.0.0.1:1011;。因?yàn)?#xff0c;在if語句中 cannot have URI part 。
總結(jié)
以上是生活随笔為你收集整理的【Nginx】错误: [emerg] “proxy_pass“ cannot have URI part in location given by regular expression,...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Nginx】location 指向某一
- 下一篇: 视频背景怎么添加视频背景怎么添加图片