If you don’t install nginx yourself or encounter a new environment and don’t know where the nginx configuration file nginx.conf is, here’s how to find it

Methods/steps

  1. System environment

  2. Nginx version

  3. Ps – ef | grep nginx can view to nginx process, but can’t find the configuration file

  4. Find the master profile

    /usr/sbin/nginx -t

  5. You can find the configuration file path

    cat /etc/nginx/nginx.conf 

  6. Go to this directory

  7. Conf files in this directory are only valid. Directories one level higher are invalid