我有一个非常基本的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;
}
}
Run Code Online (Sandbox Code Playgroud)
根据我读过的所有内容,我正确设置服务器名称.当我用它的服务器的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
Run Code Online (Sandbox Code Playgroud) 我第一次在 Fedora 24 中停止 nginx 服务器。我使用 apache 服务器进行开发。对于 onlyoffice 集成,我必须安装 nginx 服务器。我使用此命令安装了 nginx 服务器dnf install nginx
在启动 nginx 服务器之前,我停止了 apache 并禁用了它,如下所示。
\n\nsystemctl stop httpd\nsystemctl disable httpd\nRun Code Online (Sandbox Code Playgroud)\n\n如果我启动 nginx 服务器,sudo service nginx start我会收到以下错误。
Redirecting to /bin/systemctl start nginx.service\nJob for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.\nRun Code Online (Sandbox Code Playgroud)\n\n因此,我运行systemctl status nginx.service命令来了解问题详细信息,我在终端中得到了以下输出。
[root@localhost ~]# systemctl -l status nginx.service\n\xe2\x97\x8f nginx.service - The …Run Code Online (Sandbox Code Playgroud) 我安装了Varnish Cache我的CentOS服务器.我正确地尝试配置,但是当我读到许多文件时,我告诉我将apache端口更改Listen 80为Listen 8080.但我在我的服务器上找不到任何Listen 80线,/etc/httpd/conf/httpd.conf但我找到了0.0.0.0:80线路.这是一回事吗?如果那些是相同的瘦身,当我改变我的网站不工作.
我知道我犯了很大的逻辑错误,但我无法理解.
谢谢