
image.png
解決辦法
出現(xiàn)這個(gè)錯(cuò)誤,一般都是配置錯(cuò)誤導(dǎo)致的,進(jìn)入nginx的conf目錄下,檢查nginx.conf 配置文件
常見(jiàn)的錯(cuò)誤:
1: proxy_pass 后面沒(méi)有加”分號(hào)”
location ^~/prefix/ {
proxy_pass http://localhost:9095/
}
2: proxy_pass 后面的url 不規(guī)范
規(guī)范的格式:http|https://{ip}:{port}/;
最常見(jiàn)的就是忘記加協(xié)議的(忘記加https, http)
location ^~/prefix/ {
proxy_pass localhost:9095/
}
正確的配置
- 反向代理配置
server {
listen 80;
location ^~/prefix-test/ {
proxy_pass http://192.168.1.101:9095/;
}
}
- 正向代理配置
server {
listen 80;
location / {
proxy_pass https://confluence.bing.com/;
}
}