大家好,又见面了,我是你们的朋友全栈君。
nginx默认安装80端口修改- nginx默认安装80端口修改
nginx默认安装80端口修改

nginx安装启动发现80默认端口冲突,一般是和tomcat服务冲突了。 所以在这里我们直接取修改nginx的默认端口。 通过whereis nginx我们知道了nginx的配置文件目录 在配置文件目录下的sites-available目录中我们找到了default文件,进行修改,修改前先备份。

vi进去后将80端口修改成8888端口号

修改后

重启nginx,启动后没有报错。

改对应映射nginx.conf配置文件后可以重新加载一下 nginx -s reload
参考: You can run two server on the same port using nginx:
https://serverfault.com/questions/242679/how-to-run-multiple-nginx-instances-on-different-port If you installed gitlab-omnibus and if you want to change the default port:
Open /etc/gitlab/gitlab.rb Add external_url “http:// domain:NewPort” Run gitlab-ctl reconfigure If you have installed gitlab manually locate nginx’s folder (you can type whereis nginx on the console) and modify gitlab’s file on the sites-available subfolder. Normally the file you have to modify is: /etc/nginx/sites-available/gitlab
/etc/nginx/sites-available
其他报错 nginx重启报错:nginx: [error] invalid PID number “” in “/run/nginx.pid” 问题描述:执行 nginx -t 是OK的,然而在执行 nginx -s reload 的时候报错 nginx: [error] invalid PID number “” in “/run/nginx.pid”
解决办法 需要先执行
nginx -c /etc/nginx/nginx.conf
nginx.conf文件的路径可以从nginx -t的返回中找到。
nginx -s reload
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/197263.html原文链接:https://javaforall.cn


