nginx (as reverse proxy)won´t start

Awd

Verified User
Joined
Aug 9, 2015
Messages
264
Hi,

After a rewrite conf. nginx didn´t start anymore.

Code:
[root@server ~]# /usr/bin/systemctl start nginx.service 2>&1
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
[root@server ~]# systemctl status nginx.service
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/etc/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2017-12-21 13:30:25 CET; 12s ago
  Process: 17331 ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf (code=exited, status=1/FAILURE)
 Main PID: 4688 (code=exited, status=0/SUCCESS)

Dec 21 13:30:25 server.example.nl systemd[1]: Starting The nginx HTTP and reverse proxy server...
Dec 21 13:30:25 server.example.nl nginx[17331]: nginx: [emerg] "proxy_read_timeout" directive is duplicate in /etc/nginx/nginx-proxy.conf:3
Dec 21 13:30:25 server.example.nl nginx[17331]: nginx: configuration file /etc/nginx/nginx.conf test failed
Dec 21 13:30:25 server.example.nl systemd[1]: nginx.service: control process exited, code=exited status=1
Dec 21 13:30:25 server.example.nl systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
Dec 21 13:30:25 server.example.nl systemd[1]: Unit nginx.service entered failed state.
Dec 21 13:30:25 server.example.nl systemd[1]: nginx.service failed.

To solve the problem quickly I removed the line "proxy_read_timeout" from /etc/nginx/nginx-proxy.conf and nginx (as reverse proxy) started as usual. But I do not know the consequence of removing that line. And why it suddenly happened?

So my question, Is it okay to remove it? I don´t know why/where it is duplicated?

Kind regards,
Fred
 
Hello Fred,

You might need to find where else it is set. For this you can run:

Code:
grep [COLOR=#333333]proxy_read_timeout /etc/nginx/* -r
[/COLOR]
 
Also set in: /etc/nginx/nginx-defaults.conf
[root@server ~]# grep proxy_read_timeout /etc/nginx/* -r
/etc/nginx/nginx-defaults.conf:proxy_read_timeout 1800s;

in /etc/nginx/nginx-proxy.conf I removed it (it was proxy_read_timeout 300s;.
 
It should be fine to have only one directive with the biggest values.

Make sure you've got the same version of nginx-proxy.conf in /usr/local/directadmin/custombuild/custom/nginx_reverse/conf/
 
Thanks Alex.

I have the same version of nginx-prof.conf in /usr/local/directadmin/custombuild/custom/nginx_reverse/conf/.

Kind regards,
Fred
 
Back
Top