我的nginx 的組態檔如下
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 8081;
server_name localhost;
root /var/local/central/central_web/;
index index.html;
location /api {
proxy_pass http://localhost:8760;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
}
}
}
報的錯誤資訊如下: 我在Docker 容器里使用的相同配置,能夠正確訪問后臺,在獨立的centos 7 機器上訪問報錯。用vue 開發代碼,
npm run dev 啟動的前端系統訪問后臺服務也沒有問題,應該排除后臺服務的問題。對nginx 配置不熟,但配置反向代理 還有別的配置方法
。請大家指教。多謝
Failed to load resource: the server responded with a status of 502 (Bad Gateway)
uj5u.com熱心網友回復:
防火墻是否開啟???重繪頁面是否仍然是502?轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/278672.html
標籤:Web 開發
上一篇:ssm框架中在頁面上修改完資料后資料庫資料沒有被修改
下一篇:誰知道我這是什么寫法或者框架嗎?
