Nginx Tips and Tricks
Tip 1. Kill all process for nginx [If there are processes hang for nginx could cause all sorts
of problems includes]
error:
Starting LSB: Stop/start nginx...
nginx.service: Control process exited, code=exited status=1
nginx.service: Failed with result 'exit-code'.
Failed to start LSB: Stop/start nginx.
solution: sudo killall nginx
Tip 2. If you ever wanted to run command without changing directory type command as below:
Solution: nginx -t -c /etc/nginx/nginx.conf
Tip 3. If you want to see the status of nginx along with logs command below:
solution: systemctl status nginx.service && journalctl -xe
Tip 4. If you want to read file located in another directory in Linux
solution: ls folderName/ #will show you the files inside the folder name specified.
solution: cat nginx/fileName #will show (readonly mode) the file content