Skip to content

Instantly share code, notes, and snippets.

@samarpanda
Last active March 16, 2020 13:24
Show Gist options
  • Save samarpanda/6144854 to your computer and use it in GitHub Desktop.
Save samarpanda/6144854 to your computer and use it in GitHub Desktop.
Debugging Nginx Configuration!

Debugging Nginx Configuration

  • Set Nginx log-level to debug

    server {  
      error_log /var/logs/nginx/samar.error.log  debug;  
    }  
    # Word of caution: Don't forget to revert debug-level for error_log on a *very* high traffic site.  
  • Set Nginx to log errors from your IP only

    events {
      debug_connection 1.2.3.4;
    }  

    To force Nginx to log errors from only your IP, and the above block of code inside /etc/nginx/nginx.conf

  • Nginx location specific error logs

      error_log   /var/logs/nginx/samar.error.log;
      location /admin/ {
        error_log   /var/logs/nginx/admin.samar.admin.log   debug;
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment