# Password protect site except for one page

**URL:** <https://www.ruby-forum.com/t/password-protect-site-except-for-one-page/232078>\
**Category:** NGINX\
**Created:** [September 17, 2014, 1:19am UTC](https://www.ruby-forum.com/t/password-protect-site-except-for-one-page/232078 "2014-09-17T01:19:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [September 17, 2014, 1:19am UTC](https://www.ruby-forum.com/t/password-protect-site-except-for-one-page/232078/1 "2014-09-17T01:19:29Z")

</div>

Hi folks,

Does anyone have a nifty solution for this? The problem is that it’s a  
wordpress site, so just

location / {  
auth\_basic “Coming soon…”;  
auth\_basic\_user\_file /etc/nginx/security/lock;  
…  
}

location /demo {  
auth\_basic off;  
…  
}

doesn’t work for /demo due to static content, etc.

The only way I can think of is to directly lock the other pages rather  
than /

thoughts?

Steve

–  
Steve H. BSc(Hons) MIITP

> **[Linux & Admin Support Services | "Services provided by people who are...](https://www.greengecko.co.nz/)**
>
> Offers linux support services, systems and database administration, consultancy and the full development lifecycle for open source - based solutions

Linkedin: [http://www.linkedin.com/in/steveholdoway](http://www.linkedin.com/in/steveholdoway)  
Skype: sholdowa

---

<div class="post-metadata">

**Author:** ![steveybaby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@steveybaby](https://www.ruby-forum.com/u/steveybaby)\
**Post date:** [September 17, 2014, 9:10am UTC](https://www.ruby-forum.com/t/password-protect-site-except-for-one-page/232078/2 "2014-09-17T09:10:32Z")

</div>

On Wed, Sep 17, 2014 at 11:18:43AM +1200, Steve H. wrote:

Hi there,

> auth\_basic off;  
> …  
> }
> 
> doesn’t work for /demo due to static content, etc.

location /static {} ?

What are the urls that you do want to password-protect, and what are  
the urls that you do not want to password-protect?

(“one page” appears not to be “one url”.)

Alternatively, could you put all of your “demo” content below /demo?

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
