Just reloaded nginx,server status 403 forbidden suddenly
Yesterday,I just reloaded nginx,server status 403 forbidden suddenly ,now I cannot open my server ip and domain name.
My circumstance:centos7+openresty(nginx)+php+mysql
systemctl status openresty ,systemctl status php-fpm,systemctl status mysql all active status,green。
lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 32255 root 6u IPv4 170338 0t0 TCP localhost:http (LISTEN)
nginx 32332 root 6u IPv4 170338 0t0 TCP localhost:http (LISTEN)
netstat -an |grep 80
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 28071 /var/lib/mysql/mysql.sock
unix 3 [ ] STREAM CONNECTED 11800
unix 3 [ ] STREAM CONNECTED 11801 /run/systemd/journal/stdout
ps aux | grep php
root 19363 0.0 3.1 470292 31572 ? Ss 00:20 0:04 php-fpm: master process (/etc/ph-fpm.conf)
nginx 19364 0.0 0.7 470292 7228 ? S 00:20 0:00 php-fpm: pool www
nginx 19365 0.0 0.7 470292 7228 ? S 00:20 0:00 php-fpm: pool www
nginx 19366 0.0 0.7 470292 7228 ? S 00:20 0:00 php-fpm: pool www
nginx 19367 0.0 0.7 470292 7228 ? S 00:20 0:00 php-fpm: pool www
nginx 19368 0.0 0.7 470292 7232 ? S 00:20 0:00 php-fpm: pool www
nginx 19369 0.0 0.7 470292 7232 ? S 00:20 0:00 php-fpm: pool www
nginx 19370 0.0 0.7 470292 7232 ? S 00:20 0:00 php-fpm: pool www
nginx 19371 0.0 0.7 470292 7232 ? S 00:20 0:00 php-fpm: pool www
root 32204 0.0 0.0 112704 968 pts/0 R+ 17:57 0:00 grep --color=auto php
1 Reply
It looks like Nginx isn't currently listening to port 80 on your Linode's public IP address. From the configuration you've provided, the server block is set up to listen on localhost only. That's a bit different from a default setup for Nginx. Do you have any caching service, such as Varnish?
IF not, I'd recommend changing the configuration to have Nginx listening publicly on port 80, especially since you have Cloudflare set up for your domain. We have a guide on configuring Nginx that may help.