Nginx error: nginx: [error] invalid PID number ““ in “/run/nginx.pid“

Error: after modifying the configuration file, reload it, and then report an error. nginx: [error] invalid PID number “” in “/usr/local/var/run/nginx.pid”

Solution restart nginx

nginx -c /usr/local/etc/nginx/nginx.conf
nginx -s reload

View port occupancy

lsof -i:8080

Delete port 8080 process

kill -9:834

To install nginx on MAC, use nginx - V to view the installation path

configure arguments: --prefix=/usr/local/Cellar/nginx/1.19.6 --sbin-path=/usr/local/Cellar/nginx/1.19.6/bin/nginx    --conf-path=/usr/local/etc/nginx/nginx.conf

-- prefix =/usr/local/cellular/nginx/1.19.6 represents the installation path -- SBIN path represents the executable path -- conf path represents the configuration file path

Read More: