gpt4 book ai didi

nginx - Nginx无效的URL前缀

转载 作者:行者123 更新时间:2023-12-03 10:41:41 24 4
gpt4 key购买 nike

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

最佳答案

您需要在unix:路径上使用http://前缀,如下所示:

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

看到

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

关于nginx - Nginx无效的URL前缀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32992908/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com