2015-10-07 109 views
15

我有一個非常基本的nginx設置,由於某種原因失敗;Nginx無效的URL前綴

server { 
    listen 80; 
    server_name librestock.com; 

    location = /favicon.ico { access_log off; log_not_found off; } 
    location /static/ { 
     root /home/david/StockSearch/stocksearch; 
    } 

    location/{ 
     include proxy_params; 
     proxy_pass unix:/home/david/StockSearch/stocksearch/stocksearch.sock; 
    } 
} 

根據我讀過的所有內容我正確設置服務器名稱。 當我用其工作的服務器的ip替換librestock.com。

錯誤:

$ nginx -t 
nginx: [emerg] invalid URL prefix in /etc/nginx/sites-enabled/stocksearch:12 
nginx: configuration file /etc/nginx/nginx.conf test failed 
+1

'proxy_pass HTTP: // unix:/ home/...' –

+0

http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass – Deadooshka

回答