# Nginx recreating default configuration files

**URL:** <https://www.ruby-forum.com/t/nginx-recreating-default-configuration-files/217800>\
**Category:** NGINX\
**Created:** [March 13, 2012, 3:46pm UTC](https://www.ruby-forum.com/t/nginx-recreating-default-configuration-files/217800 "2012-03-13T15:46:20Z")\
**Posts on this page:** 5\
**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:** [March 13, 2012, 3:46pm UTC](https://www.ruby-forum.com/t/nginx-recreating-default-configuration-files/217800/1 "2012-03-13T15:46:20Z")

</div>

I’m not sure how or why this happened, but nginx recreating the default  
configuration files in the conf.d directory. This caused it to attempt  
to  
bind to all interfaces on my server.

Is there a way to prevent this from happening in the future?

---

<div class="post-metadata">

**Author:** ![Bai\_Shen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Bai\_Shen](https://www.ruby-forum.com/u/Bai_Shen)\
**Post date:** [March 13, 2012, 5:10pm UTC](https://www.ruby-forum.com/t/nginx-recreating-default-configuration-files/217800/2 "2012-03-13T17:10:30Z")

</div>

On Tue, 2012-03-13 at 10:45 -0400, Bai Shen wrote:

> I’m not sure how or why this happened, but nginx recreating the  
> default configuration files in the conf.d directory. This caused it  
> to attempt to bind to all interfaces on my server.
> 
> Is there a way to prevent this from happening in the future?

Nginx doesn’t ever write configuration files. How did you install  
Nginx? My first guess is that you are using a non-official repository  
(i.e. a PPA) and they pushed a new configuration.

Regards,  
Cliff

---

<div class="post-metadata">

**Author:** ![Bai\_Shen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Bai\_Shen](https://www.ruby-forum.com/u/Bai_Shen)\
**Post date:** [March 13, 2012, 5:57pm UTC](https://www.ruby-forum.com/t/nginx-recreating-default-configuration-files/217800/3 "2012-03-13T17:57:34Z")

</div>

I did the install by adding the nginx repo to my RH box. Then doing yum  
install nginx. I haven’t done an update, so I’m not sure how anyone  
could  
have pushed a new configuration.

---

<div class="post-metadata">

**Author:** ![Bai\_Shen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Bai\_Shen](https://www.ruby-forum.com/u/Bai_Shen)\
**Post date:** [March 13, 2012, 6:52pm UTC](https://www.ruby-forum.com/t/nginx-recreating-default-configuration-files/217800/4 "2012-03-13T18:52:28Z")

</div>

On Tue, 2012-03-13 at 12:57 -0400, Bai Shen wrote:

> I did the install by adding the nginx repo to my RH box. Then doing  
> yum install nginx. I haven’t done an update, so I’m not sure how  
> anyone could have pushed a new configuration.

My only guess then would be that somehow you reverted it yourself, or it  
was somehow never changed in the first place. I know I’ve done similar  
things (having the same file open in multiple editors, renaming a file  
and forgetting to reopen the buffer in emacs, etc).

Regards,  
Cliff

---

<div class="post-metadata">

**Author:** ![Bai\_Shen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6a8cbe/32.png) [@Bai\_Shen](https://www.ruby-forum.com/u/Bai_Shen)\
**Post date:** [March 14, 2012, 1:50pm UTC](https://www.ruby-forum.com/t/nginx-recreating-default-configuration-files/217800/5 "2012-03-14T13:50:16Z")

</div>

I’m not sure how that could have happened. I had renamed the files to  
add  
.orig to the end so nginx wouldn’t pick them up. When I looked in the  
directory, there were two copies of the files. One with .orig and one  
without.
