A photo of Mitesh Shah

Mitesh Shah

Linux Expert | Automation Enthusiast | Security Consultant

Email Skype Github Twitter Resume Hire Me Keybase LinkedIn Stackoverflow


How to Fix NGINX Reload Issue

Overview

How to Fix NGINX Reload Issue

NGINX reload issue

# Check NGINX configuration
$^_^[root@MiteshShah:~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

# As NGINX configuration test passed
# Let's reload NGINX
^_^[root@MiteshShah:~]# service nginx reload
reload: Job is not running: nginx

How to Fix

# Kill all the NGINX listen port
O_O[root@MiteshShah:~]# fuser -k 80/tcp;
80/tcp:               3145  3146
^_^[root@MiteshShah:~]# fuser -k 443/tcp;
443/tcp:               3150  3151

# Check NGINX configuration
$^_^[root@MiteshShah:~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

# As NGINX configuration test passed
# Let's restart NGINX
O_O[root@MiteshShah:~]# service nginx restart
nginx stop/waiting
nginx start/running, process 26068

# Now Let's reload NGINX
^_^[root@MiteshShah:~]# service nginx reload
^_^[root@MiteshShah:~]# echo $?
0

NOTE!: After killing NGINX connection & restart NGINX Next time NGINX reload works properly.





Post Navigation