把前端H5代碼上傳到前端服務(wù)器;
1、沒(méi)有設(shè)置反向代理,可以直接訪問(wèn),但是點(diǎn)擊到別的頁(yè)面再點(diǎn)瀏覽器的返回按鈕,就會(huì)整個(gè)退出,無(wú)法直接通過(guò)鏈接訪問(wèn)首頁(yè)以外的頁(yè)面;
2、設(shè)置了反向代理,就無(wú)法訪問(wèn)網(wǎng)站:nginx 502 Bad Gateway,以下是反向代理的配置信息
#PROXY-START/
location ^~ /
{
proxy_pass http://前端服務(wù)器IP:8325;
proxy_http_version 1.1;
proxy_read_timeout 360s;
proxy_redirect off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host 后端服務(wù)器IP;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_fileLzXnun8E 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_fileLzXnun8E 1;
expires 12h;
}
if ( $static_fileLzXnun8E = 0 )
{
add_header Cache-Control no-cache;
}
}
#PROXY-END/