【问题标题】:Nginx invalid URL prefixNginx 无效的 URL 前缀
【发布时间】:2016-01-04 17:23:59
【问题描述】:

我有一个非常基本的 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

【问题讨论】:

标签: nginx


【解决方案1】:

您需要在 unix: 路径上添加 http:// 前缀,如:

proxy_pass http://unix:/home/david/StockSearch/stocksearch/stocksearch.sock;

http://nginx.org/en/docs/http/ngx_http_proxy_module.html

【讨论】:

    猜你喜欢
    • 2022-11-24
    • 2020-05-26
    • 1970-01-01
    • 1970-01-01
    • 2013-10-06
    • 1970-01-01
    • 2016-11-22
    • 1970-01-01
    • 2014-01-30
    相关资源
    最近更新 更多