对 nginx 配置啥的不太熟悉。这几天在 vps 上搭了 frp,绑定了个域名给 frp 用。但是 frp 配置 vhost 的端口如果不是 80 的话,每次还得在域名后加端口或者再去 nginx 做转发。就想着把 80 端口给 frp 用,然后把 nginx 的默认监听改到 8080 之类的。
说干就干,先把 nginx 停了之后,把 fprs 配置文件中的 vhost 端口改为 80,然后重启 frp。实现了 frp 的所有 subdomain 能够直接通过类似 test.v2ex.com 直接访问,不用再加端口号。
然后就开始改 nginx 的配置: /www/server/nginx/conf/nginx.conf 将之前默认监听的 80 端口改为 8080 端口
server {
listen 8080;
listen [::]:8080;
return 301 https://$host$request_uri;
}
重新启动 nginx,还是会提示 80 端口已经占用,就是现在没有读到修改后的配置,还是说我改的配置文件不对?
[root@frps]# nginx
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
各位帮忙分析下问题的原因呗....多谢! Ps:nginx 是用宝塔面板直接装的。
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.