[英]Nginx will not start because I made a mistake and don't know how to reverse it
I am following this tutorial in order to learn how to deploy flask-react applications from a singe nginx server, but I made the mistake of trying this command: $ sudo ln -s /etc/nginx/sites-available/react-flask-app.nginx /etc/nginx/sites-enabled/react-flask-app.nginx
, but it happens that my file has no nginx
extension, so the command should have been $ sudo ln -s /etc/nginx/sites-available/react-flask-app /etc/nginx/sites-enabled/react-flask-app
.我正在关注本教程,以了解如何从单个 nginx 服务器部署烧瓶反应应用程序,但我在尝试此命令时犯了错误:
$ sudo ln -s /etc/nginx/sites-available/react-flask-app.nginx /etc/nginx/sites-enabled/react-flask-app.nginx
, but it happens that my file has no nginx
extension, so the command should have been $ sudo ln -s /etc/nginx/sites-available/react-flask-app /etc/nginx/sites-enabled/react-flask-app
。 Now nginx refuses to start with command sudo systemctl start nginx
, and command systemctl status nginx.service
returns the following:现在 nginx 拒绝使用命令
sudo systemctl start nginx
,命令systemctl status nginx.service
返回以下内容:
Dec 14 16:32:21 ip-172-31-5-99 systemd[1]: Starting A high performance web server and a reverse proxy server...
Dec 14 16:32:21 ip-172-31-5-99 nginx[2017]: nginx: [emerg] open() "/etc/nginx/sites-enabled/react-flask-app.nginx" failed (2: No such file or directory) in /etc/nginx/nginx.conf:62
Dec 14 16:32:21 ip-172-31-5-99 nginx[2017]: nginx: configuration file /etc/nginx/nginx.conf test failed
Dec 14 16:32:21 ip-172-31-5-99 systemd[1]: nginx.service: Control process exited, code=exited status=1
Dec 14 16:32:21 ip-172-31-5-99 systemd[1]: nginx.service: Failed with result 'exit-code'.
Dec 14 16:32:21 ip-172-31-5-99 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
I don't know how to instruct nginx to forget about that file, I already stopped, started and reloaded nginx.我不知道如何指示 nginx 忘记那个文件,我已经停止、启动并重新加载了 nginx。
I found that a file with the name react-flask-app.nginx
was created in /etc/nginx/sites-enabled
, and such file contains the error message.我发现在
/etc/nginx/sites-enabled
中创建了一个名为react-flask-app.nginx
的文件,并且该文件包含错误消息。 I only deleted the file and everything went back to normal.我只删除了文件,一切恢复正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.