problem:
After restarting the virtual machine, restarting nginx again will report an error: open() “/var/run/nginx/nginx.pid” failed (2: No such file or directory)
Solution:
(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/nginx.pid;
(3) Release the comment and modify it to: pid /usr/local/nginx/logs/nginx.pid;
(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:
- Nginx error: nginx: [error] invalid PID number ““ in “/run/nginx.pid“
- [Solved] Nginx Restart Error: /run/nginx.pid failed (2: No such file or directory)
- [Solved] nginx: [error] open() “/usr/local/nginx/nginx.pid” failed (2: No such file or directory)
- Nginx Error: Swap file “/etc/nginx/.nginx.conf.swp“ already exists
- Nginx Startup Error: Job for nginx.service failed because the control process exited with error code
- Nginx Error: nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /project/api/nginx.conf:
- [Solved] Nginx Startup Error: directive is not allowed here in
- nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
- Nginx Error: [emerg] bind() to [::]:80 failed (98: Address already in use)
- Restart and stop of nginx in Linux service
- Common configuration methods of nginx
- Nginx Reverse Proxy 426 Error [How to Fix]
- Nginx realizes the same background service for portal and business
- Solve the problem of 404 Not Found error in nginx accessing dynamic interface
- [Solved] Nginx cannot access pictures on FTP Error: Whitelabel error page
- Nginx configuration 80 can be accessed by forcing jump 443 or not
- How to Fix No default.conf file in conf.d after Installing Nginx
- summary of configuration and deployment of uwsgi+nginx+flag in centos7 and why internal server error is prompted [official instructions]
- [Solved] Error during installation of nginx: Make: * * * [build] error 2
- Nginx routes and forwards according to the URL and cuts the URL