1. 項目在nginx上如下部署,結(jié)果反饋3600極速版訪問不了:
server {
listen 80;
listen [::]:80;
server_name localhost admin.XXX.com;
location / {
#? ? ? ? rewrite ^/(.*) https://$host/$1 permanent;
root /home/arch/MobCastle_UI_new_v7;
index login.html index.html index.htm;
}
2.? 如下方式部署就可以訪問了,真的如是达吞?
server {
listen 80;
listen [::]:80;
root /home/arch/MobCastle_UI_new_v7;
index login.html login.htm index.html index.htm;
server_name admins.XXX.com;
location /MobCastle_UI_new {
alias /home/arch/MobCastle_UI_new_v7;
index login.html index.html index.htm;
}
}
3. 再次親臨現(xiàn)場目睹了一次济赎,果然如此惊畏。一直認(rèn)為上述兩種部署方式?jīng)]有什么根本區(qū)別(對于之訪問根目錄的項目來說)扰法,沒想到此處看到了之前反應(yīng)的360急速瀏覽器點(diǎn)擊登錄完全不動(js完全不出發(fā)轧飞,其他頁面css還失效)這類讓人疑惑的情況背后的原因——原來竟是nginx部署方式導(dǎo)致的衅鹿!
4. 發(fā)現(xiàn)上述區(qū)別還應(yīng)該感謝當(dāng)時沒有不動腦地直接拷貝nginx部署的代碼,而是在另一臺服務(wù)器上DIY了一下过咬。這才偶然看到這樣的區(qū)別大渤!