Nginx Startup Error: “/var/run/nginx/” failed” [How to Solve]


  After restarting the virtual machine, restarting nginx again will report an error: open() “/var/run/nginx/” failed (2: No such file or directory)


  (1) Enter the cd /usr/local/nginx/conf/ directory and edit the configuration file nginx.conf;

  (2) There is a comment in the configuration file: #pid logs/;

 (3) Release the comment and modify it to: pid /usr/local/nginx/logs/;

  (4) Create a logs directory under the /usr/local/nginx directory: mkdir /usr/local/nginx/logs

  (5) Start nginx service: /usr/local/nginx/sbin/nginx

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *