2013-10-29 83 views
0

當我試圖運行下面的nginx配置文件時,我得到錯誤無法GET /索引使用http://domain_name/index。當我打到http://domain_name時,其呼叫127.0.0.1/3000。我在這裏做錯了什麼。任何對此的幫助將會非常有幫助。Nginx位置指令無法訪問

error_log /tmp/logs/error.log; 
events { 
    worker_connections 1024; 
} 

http { 
    include  mime.types; 
    default_type application/octet-stream; 
    access_log /tmp/logs/access.log; 
    sendfile  on; 
    keepalive_timeout 65; 

    include /etc/nginx/sites-enabled/*; 

    # BELOW IS THE PART TO PROXY MY samp1.js and samp2.js APP 

    upstream first_entry { 
    server 127.0.0.1:3000; 
    } 
    upstream second_entry { 
    server 127.0.0.1:5000; 
    } 
    server { 
    listen 80; 
    server_name domain_name; 
    location/{ 
     proxy_pass http://first_entry; 
    } 
    location /index { 
     proxy_pass http://second_entry; 
    } 
    } 
} 
+0

URL'http://127.0.0.1:5000'是否自行工作? –

+0

@Mhamhammad AbuShady是它的工作 – user87267867

回答

0

該指令error_log /path/to/log/files/debug.log;和​​擴展服務器塊。然後在您的瀏覽器中輸入tail -f /path/to/log/files/debug.log並輸入http://domain_name/index。您現在可以在解析輸入URL時看到nginx正在做什麼。這應該可以幫助您調試問題。

請在您的問題中發佈此輸出以獲得進一步的幫助,並讓我知道我是否可以獲得進一步的幫助。