/etc/Nginx
我的问题是 监听80端口;
如果是其他的端口就是OK的,只要一切换到80端口,就自动是默认页面welcome to Nginx
我们对Nginx的配置主要写在Nginx.conf文件里,这个目录下还有conf.d和sites-enabled两个文件夹,里面为默认的配置文件。
相应的,在配置Nginx,编辑Nginx.conf文件时,需要把这两行注释掉,否则Nginx.conf不会生效。
server{
listen 80;
server_name dev.lixingjiaoyu.com;
location / {
root /usr/local/presbyter/server/build;
try_files $uri $uri/ @router;
index index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
配置完毕后,检查配置文件是否正确:
Nginx -t
重启Nginx使配置生效:
Nginx -s reload
如果不成功,或者若出现以下错误:
Nginx:[error] open() "/run/Nginx.pid" Failed (2: No such file or directory)
使用以下命令即可解决:
Nginx -c /etc/Nginx/Nginx.conf
Nginx -s reload
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。