# Does auth\_basic changes require a service reload?

**URL:** <https://www.ruby-forum.com/t/does-auth-basic-changes-require-a-service-reload/219261>\
**Category:** NGINX\
**Created:** [April 25, 2012, 7:00pm UTC](https://www.ruby-forum.com/t/does-auth-basic-changes-require-a-service-reload/219261 "2012-04-25T19:00:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gurdipe\_D](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b77776/32.png) [@Gurdipe\_D](https://www.ruby-forum.com/u/Gurdipe_D)\
**Post date:** [April 25, 2012, 7:00pm UTC](https://www.ruby-forum.com/t/does-auth-basic-changes-require-a-service-reload/219261/1 "2012-04-25T19:00:41Z")

</div>

Hi,

I’m wondering if I need to perform a “service nginx restart”, if I do  
any changes to htpasswd file:  
location / {  
auth\_basic “closed site”;  
auth\_basic\_user\_file htpasswd;  
}

I noticed that sometimes it works without reloading the service.

Posted at Nginx Forum:

> **[Does auth\_basic changes require a service reload?](https://forum.nginx.org/read.php?2,225777,225777#msg-225777)**
>
> Hi, I'm wondering if I need to perform a "service nginx restart", if I do any changes to htpasswd file: location / { auth\_basic "closed site"; auth\_basic\_user\_file htpasswd; } I noticed that sometimes it

---

<div class="post-metadata">

**Author:** ![teck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b2d939/32.png) [@teck](https://www.ruby-forum.com/u/teck)\
**Post date:** [April 26, 2012, 11:36am UTC](https://www.ruby-forum.com/t/does-auth-basic-changes-require-a-service-reload/219261/2 "2012-04-26T11:36:55Z")

</div>

Hello!

On Wed, Apr 25, 2012 at 12:59:50PM -0400, TECK wrote:

> Hi,
> 
> I’m wondering if I need to perform a “service nginx restart”, if I do  
> any changes to htpasswd file:  
> location / {  
> auth\_basic “closed site”;  
> auth\_basic\_user\_file htpasswd;  
> }
> 
> I noticed that sometimes it works without reloading the service.

The htpasswd file is looked up at runtime, no reload/restart  
needed after it’s change.

Maxim D.

---

<div class="post-metadata">

**Author:** ![teck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b2d939/32.png) [@teck](https://www.ruby-forum.com/u/teck)\
**Post date:** [April 26, 2012, 4:10pm UTC](https://www.ruby-forum.com/t/does-auth-basic-changes-require-a-service-reload/219261/3 "2012-04-26T16:10:44Z")

</div>

Sorry to repeat myself Maxim. The file is looked at startup so if I add  
a new user or edit an existing password, it will not require a service  
restart?

Posted at Nginx Forum:

> **[Re: Does auth\_basic changes require a service reload?](https://forum.nginx.org/read.php?2,225777,225825#msg-225825)**
>
> Hi, I'm wondering if I need to perform a "service nginx restart", if I do any changes to htpasswd file: location / { auth\_basic "closed site"; auth\_basic\_user\_file htpasswd; } I noticed that sometimes it

---

<div class="post-metadata">

**Author:** ![teck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/b2d939/32.png) [@teck](https://www.ruby-forum.com/u/teck)\
**Post date:** [April 26, 2012, 4:27pm UTC](https://www.ruby-forum.com/t/does-auth-basic-changes-require-a-service-reload/219261/4 "2012-04-26T16:27:28Z")

</div>

Hello!

On Thu, Apr 26, 2012 at 10:10:16AM -0400, TECK wrote:

> Sorry to repeat myself Maxim. The file is looked at startup so if I add  
> a new user or edit an existing password, it will not require a service  
> restart?

The file is looked at runtime, i.e. when request comes and nginx  
checks authentication/authorization for a particular request.  
There is no need to reload/restart nginx if you add users or  
change passwords of existing users.

Maxim D.
