# Re: nginx.conf File too Large

**URL:** <https://www.ruby-forum.com/t/re-nginx-conf-file-too-large/209184>\
**Category:** NGINX\
**Created:** [July 7, 2011, 3:46pm UTC](https://www.ruby-forum.com/t/re-nginx-conf-file-too-large/209184 "2011-07-07T15:46:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [July 7, 2011, 3:46pm UTC](https://www.ruby-forum.com/t/re-nginx-conf-file-too-large/209184/1 "2011-07-07T15:46:09Z")

</div>

Alexandr,

As of right now we are only using the configuration for one of our  
customers  
in beta and nginx is not giving any errors. Before we migrate more  
customers onto the platform we wanted to get a better idea of the  
hypothetical ramifications of having such a large config file. What are  
the  
best practices for config files and what could go wrong if we have a  
large  
number of hosts configured onto one nginx server each with a lot of  
conditions?

Thanks,  
Rami

Date: Wed, 6 Jul 2011 22:41:49 +0300  
From: Alexandr G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: removed\_email\_address@domain.invalid  
Subject: Re: nginx.conf File too Large  
Message-ID:  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Content-Type: text/plain; charset=ISO-8859-1

On 7/6/11, Rami E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> We are trying to use nginx as a reverse proxy for a large number of sites  
> and putting up a lot of rules to direct and traffic for each host. Is  
> there  
> a number of hosts ({server}) that would be too many for a single nginx  
> instance to support? At what point does the configuration file get too  
> large  
> and start bogging down the nginx server? Currently each host takes up  
> about  
> 150 lines, and we are looking to put in 25+ hosts onto each server. I  
> wanted  
> to know if this realistic?

It doesn’t sound like an nginx problem. Nginx usually suggests what to  
change if it hits the limit. Can you show us the exact error message?

---

<div class="post-metadata">

**Author:** ![Rami\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Rami\_E](https://www.ruby-forum.com/u/Rami_E)\
**Post date:** [July 8, 2011, 3:32pm UTC](https://www.ruby-forum.com/t/re-nginx-conf-file-too-large/209184/2 "2011-07-08T15:32:19Z")

</div>

It just depends what you consider a large configuration. For example we  
have a bunch of Ngnix instances running each with roughly 200,000 lines  
of configuration, although taking just the raw number of lines as such  
might be a bad metric.

Posted at Nginx Forum:

> **[Re: nginx.conf File too Large](https://forum.nginx.org/read.php?2,211995,212028#msg-212028)**
>
> Hi Guys, I am sorry to email this out but I put it on the forum and got nothing back back. I'm hoping someone may be able to give me a little advice. We are trying to use nginx as a reverse proxy for a large number of sites and putting up a lot of...

---

<div class="post-metadata">

**Author:** ![Rami\_E](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/f05b48/32.png) [@Rami\_E](https://www.ruby-forum.com/u/Rami_E)\
**Post date:** [July 8, 2011, 4:07pm UTC](https://www.ruby-forum.com/t/re-nginx-conf-file-too-large/209184/3 "2011-07-08T16:07:34Z")

</div>

Thanks for the advise. I guess the only way is to try it and keep an  
eye on  
the performance.
