Postmortem Nginx Server Issue

Issue Summary:

Root Cause:

  • The Nginx configuration files in /etc/nginx/ had no proper user permissions. In order to run a ngix server, the nginx user should be able to access these files with read and write permissions.
  • The Nginx configuration files didn't have the proper ownership.
  • In the configuration file /etc/nginx/sites-enabled/default was a bad configuration, usually, the server should allow income connections in port 8080, but it was set to port 80.
  • There was an Apache process running and using the needed port.

Timeline (format bullet point, format: time - keep it short, 1 or 2 sentences):

  • Debugging, Actions, and process to fix the Issue:
    - First I tried to run the service with the command sudo service nginx start, the server was running but it has problems to work, the connections were not allowed on port 8080. So I stopped the service and changed the configuration file: /etc/nginx/sites-enabled/default.
    -
    I realized that the nginx processes weren’t running from the right user, and checked for the folder permissions, then I changed it, also changed ownership of the configuration folder /etc/nginx/ .
    -
    Then, I killed the apache server that was running to avoid conflicts with a special flat to be sure that previous processes with the same name were able.
    - Finally, restart the nginx service.
  • Things that can be improved/fixed :
    - The original configuration of the server should be correctively done set only for nginx server running, not any other web service to avoid conflicts and issues.
    - When setting nginx ensure the ownership and permissions to be correctly set, the user and group for this is nginx.
  • List of tasks to address the issue:
  • Patch nginx server configuration files
    - Verify and change permissions and ownership on configuration folder and files.
    - Kill other web server services running.

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store