我有一个非常基本的nginx设置,由于某种原因失败了;
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
答案 0 :(得分:22)
您需要在unix:path上使用http://前缀,如:
proxy_pass http://unix:/home/david/StockSearch/stocksearch/stocksearch.sock;
见