Check to see if nginx is running:
ps aux | grep nginx
Find what process is bound to a port:
lsof -n -i:8003
tcp dump of all traffic on port
sudo tcpdump -i any port 443
For quick restarting:
sudo nginx -t && sudo nginx -s reload
For testing matching rules:
location /api {
# proxy_pass http://localhost:8001;
add_header Content-Type text/html;
return 200 'api...';
}
Following error logs on Mac: tail -f /usr/local/var/log/nginx/error.log
Following error logs on Ubuntu:
tail -f /var/log/nginx/error.log
User nginx user:
ps -ef | grep nginx
Useful for listing all bound ports