Fix Nginx start stop frequenly

Tác giả: Dương Nguyễn Phú Cường
Ngày đăng: 2 tuần trước
Lượt xem: 20


My server worked with these changes:
CODE: SELECT ALL
# nano /etc/sysctl.d/disable_ipv6.conf
Paste this:
CODE: SELECT ALL
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
CODE: SELECT ALL
# nano /usr/lib/systemd/system/nginx.service
Find:
CODE: SELECT ALL
PIDFile=/var/run/nginx.pid
Replace with:
CODE: SELECT ALL
PIDFile=/run/nginx.pid
CODE: SELECT ALL
# nano /etc/nginx/nginx.conf
Find:
CODE: SELECT ALL
pid /var/run/nginx.pid;
Replace with:
CODE: SELECT ALL
pid /run/nginx.pid;
CODE: SELECT ALL
# systemctl daemon-reload
# reboot