修改了nginx.config 新增了一条转发
执行nginx -s reload 的时候报错了
nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
网上说执行
nginx -c /etc/nginx/nginx.conf
我执行后又报了下面的错
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:443 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:443 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:443 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:443 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:443 failed (98: Address already in use)
nginx: [emerg] still could not bind()
最后需要执行
sudo pkill -f nginx & wait $!
sudo systemctl start nginx
重启nginx才恢复正常
打赏
![支付宝](/upload/2022/05/1651482452154_%5BB@424c63-369b0d44790743a0b4fdf88dcc504331.jpg)
![微信](/upload/2022/05/mm_facetoface_collect_qrcode_1651482467494_%5BB@ea59683-70ede9d4f4b5441f88084e521fe089a9.png)