我有一个非常基本的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; } }
根据我读过的一切,我正确地设置服务器名称。 当我用它的工作原理的IPreplacelibrestock.com。
错误:
$ nginx -t nginx: [emerg] invalid URL prefix in /etc/nginx/sites-enabled/stocksearch:12 nginx: configuration file /etc/nginx/nginx.conf test failed
你需要在你的unix路径上使用http://前缀,如下所示:
proxy_pass http://unix:/home/david/StockSearch/stocksearch/stocksearch.sock;
看到