nginx: [emerg] unknown "root" variable - nginx

I am using easyengine and suddenly nginx is not reloading. I went to the log and nginx -t, its saying nginx: [emerg] unknown "root" variable and it failed to test. My sites are down. Is there anyone to help?

Related

MAMP Pro nginx won't start

Last week I was able to use MAMP Pro on MacOS Big Sur 11.6 (Mackbook Pro M1) to run the nginx web server for multiple virtual hosts. Today, after using certbot locally in renewing my local LetsEncrypt SSL certificate that supports local dev https development, I cannot start nginx on any of the virtual hosts.
I get a warning in MAMP Pro that says "You configured nginx to use ports 80 and 443, but at least one of these seems to be in use." So I checked that MAMP is still configured to use port 80 for nginx. Then I used Activity Monitor to try to kill all httpd processes using port 80. Two of them, owned by root and _www, refused to die. So I used kill -9 with their respective PIDs. That killed them for a moment but they came back. After that, I tried to restart nginx again on port 80. It fails to start with message "Nginx couldn't be started. Please check the log file for more information."
The log file from that shows
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: bind() to 0.0.0.0:80 failed (48: Address already in use)
2021/12/28 16:04:22 [emerg] 93920#0: still could not bind()
How do I fully kill the root and _www user processes? More importantly, why is this happening? Was it something to do with the renewed LetsEncrypt SSL?
Support told me that this is a problem with MAMP Pro 5 on MacOS and that MAMP Pro 5 is no longer supported. Upgrading to MAMP 6+ solves the problem.

nginx: configuration file /etc/nginx/nginx.conf test failed WHY?

Why is the error occurring?
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2021/05/21 09:12:03 [warn] 1079#1079: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2021/05/21 09:12:03 [emerg] 1079#1079: a duplicate default server for 0.0.0.0:80 in /etc/nginx/sites-enabled/goodrpi.com:22
nginx: configuration file /etc/nginx/nginx.conf test failed

Nginx failed to bind and redirection

I'm trying to configure my reverse proxy through nginx using this tutorial, but when I go to restart the nginx server, it throws the following error message:
nginx[12681]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
I checked out the port using netstat, and I have the following result
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN off (0.00/0/0)
What does this mean? When I go to my domain name, it redirects to the Centos page instead of an nginx page I should be getting. How can I configure the file to get it to redirect to nginx?
Edit:
Added httpd status
httpd.service disabled
mysql.service enabled
my_api.service enabled
nginx.service disabled
I get the above errors when I try to start nginx using systemctl
Running netstat -luntp as root showed that nginx had spawned a master process and a worker. Killing those processes solved the issue

get_name:no start line:Expecting: TRUSTED CERTIFICATE

I have already written "TRUSTED CERTIFICATE" and "END TRUSTED CERTIFICATE" in my text file but an error occurred.
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: [emerg] PEM_read_bio_X509_AUX("/etc/ssl/certs/surveyspan.crt") failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: TRUSTED CERTIFICATE)
nginx: configuration file /etc/nginx/nginx.conf test failed

Nginx Doesn't Work After Compiling from Source and Installing

I've compiled and installed nginx from source with three easy commands:
./configure
make
sudo make install
Now when I try to run nginx under my default user, I get this message:
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
It also doesn't work with sudo with a pretty strange error:
sudo: nginx: command not found
So does anybody know: What can I do in this situation?
Add /usr/local/nginx/sbin to your PATH variable in /etc/environment.

Resources