鍍金池/ 問答/Linux/ Linux 使用非 80 端口配置失效?

Linux 使用非 80 端口配置失效?

nginx 配置使用81端口訪問,不能正確定位 index.html ,需要手動輸入?

server {
        listen       81;
        root /www/web/xxxx/public_html;
        server_name xxxx.com;
        index  index.html index.php index.htm;
        error_page  400 /errpage/400.html;
        error_page  403 /errpage/403.html;
        error_page  404 /errpage/404.html;
        error_page  503 /errpage/503.html;
        location ~ \.php$ {
                proxy_pass http://127.0.0.1:88;
                include naproxy.conf;
        }
        location ~ /\.ht {
                deny  all;
        }
        location / {
                try_files $uri @apache;
        }
        location @apache {
                 proxy_pass http://127.0.0.1:88;
                 include naproxy.conf;
        }
}

clipboard.png

為何如此奇怪?經過測試這個配置是成功的,輸入完整地址時

clipboard.png

目錄文件如下

clipboard.png

無法解析 php 文件。。。

clipboard.png

clipboard.png

回答
編輯回答
夢囈

添加這個默認請求定位

location / {

        
        #定義首頁索引文件的名稱
        index index.php index.html index.htm;   

    }

手機評論,格式見諒

2017年6月1日 10:33
編輯回答
只愛你

問題解決了,Apache 配置有問題。

2017年6月9日 15:24