# Server won't start AND Nginx as reverse proxy

**URL:** <https://www.ruby-forum.com/t/server-wont-start-and-nginx-as-reverse-proxy/225370>\
**Category:** NGINX\
**Created:** [January 3, 2013, 2:49pm UTC](https://www.ruby-forum.com/t/server-wont-start-and-nginx-as-reverse-proxy/225370 "2013-01-03T14:49:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [January 3, 2013, 2:49pm UTC](https://www.ruby-forum.com/t/server-wont-start-and-nginx-as-reverse-proxy/225370/1 "2013-01-03T14:49:23Z")

</div>

Hi guys,

I have two issues on which I can not seem to find decent help:

1- See the configuration below. If the [https://some.site.com](https://some.site.com) site is  
down,  
Nginx won’t start. I still want Nginx to start whether this site is down  
or  
not:

server {  
listen 8000;  
location / {  
proxy\_pass [https://some.site.com](https://some.site.com);  
}  
}

2- We have set up Nginx as a reverse proxy server to send users to a few  
backend Swazoo web servers. If a particular Swazoo web server is  
currently  
busy handling a request, Nginx does not reverse proxy new incoming  
requests  
to one of the other Swazoo web servers and the site appears to be  
‘hanging’.  
Any help on this?

Thanks!

Posted at Nginx Forum:

> **[Server won't start AND Nginx as reverse proxy](https://forum.nginx.org/read.php?2,234664,234664#msg-234664)**
>
> Hi guys, I have two issues on which I can not seem to find decent help: 1- See the configuration below. If the https://some.site.com site is down, Nginx won't start. I still want Nginx to start whether this site is down or not: server { listen

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 24, 2013, 1:31pm UTC](https://www.ruby-forum.com/t/server-wont-start-and-nginx-as-reverse-proxy/225370/2 "2013-01-24T13:31:50Z")

</div>

Hi guys,

Concerning the first issue I had, I managed to get Nginx to now startup  
when  
I reboot the system, but the only way I could get it to work was by  
adding a  
sleep of a couple of seconds to the /etc/init.d/nginx startup script.

Is this acceptable practice?

Thanks,  
Pieter

Posted at Nginx Forum:

> **[Re: Server won't start AND Nginx as reverse proxy](https://forum.nginx.org/read.php?2,234664,235536#msg-235536)**
>
> Hi guys, I have two issues on which I can not seem to find decent help: 1- See the configuration below. If the https://some.site.com site is down, Nginx won't start. I still want Nginx to start whether this site is down or not: server { listen

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 24, 2013, 1:56pm UTC](https://www.ruby-forum.com/t/server-wont-start-and-nginx-as-reverse-proxy/225370/3 "2013-01-24T13:56:59Z")

</div>

On 24 Jan 2013 13h31 CET, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi guys,
> 
> Concerning the first issue I had, I managed to get Nginx to now  
> startup when I reboot the system, but the only way I could get it to  
> work was by adding a sleep of a couple of seconds to the  
> /etc/init.d/nginx startup script.
> 
> Is this acceptable practice?

No.

Something is wrong with your setup.  
— appa

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 24, 2013, 6:28pm UTC](https://www.ruby-forum.com/t/server-wont-start-and-nginx-as-reverse-proxy/225370/4 "2013-01-24T18:28:51Z")

</div>

> 2- Nginx does not reverse proxy new incoming requests to one of the other  
> Swazoo web servers and the site appears to be ‘hanging’. Any help on this?

The default proxy module timeouts are pretty high (like 60s)

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

.. so naturally if the backend doesnt respond in timely matter it can  
take  
up to a minute for nginx to decide what to do next.

I would also rather than using (with dns resolve):

location / {  
proxy\_pass [https://some.site.com](https://some.site.com);  
}

choose the upstream module (  
[Module ngx\_http\_upstream\_module](http://nginx.org/en/docs/http/ngx_http_upstream_module.html) ) and define  
all  
the backends in the upstream {} block:

upstream someservers {  
server your.backend1.ip:80;  
server your.backend2.ip:80;  
server your.backend2.ip:80;  
}

location / {  
proxy\_pass [http://someservers](http://someservers);  
}

rr
