# How to allow only specific URL's in maintenance mode?

**URL:** <https://www.ruby-forum.com/t/how-to-allow-only-specific-urls-in-maintenance-mode/214773>\
**Category:** NGINX\
**Created:** [December 12, 2011, 6:49am UTC](https://www.ruby-forum.com/t/how-to-allow-only-specific-urls-in-maintenance-mode/214773 "2011-12-12T06:49:49Z")\
**Posts on this page:** 1\
**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:** [December 12, 2011, 6:49am UTC](https://www.ruby-forum.com/t/how-to-allow-only-specific-urls-in-maintenance-mode/214773/1 "2011-12-12T06:49:49Z")

</div>

My maintenance mode config is as follows :

if (-f $errorroot/maintenance.html)  
{  
return 503;  
}

error\_page 503 @maintenance;

location @maintenance  
{  
rewrite ^(.\*)$ /maintenance.html break;  
proxy\_method GET;  
proxy\_pass [http://localhost:100](http://localhost:100);  
}

What it is doing is rewriting all the url to /maintenance.html if that  
file is present.  
Now I want to allow only a few url’s - they have to be accessible during  
maintenance mode too.

Can we achieve that?

Posted at Nginx Forum:

> **[How to allow only specific URL's in maintenance mode?](https://forum.nginx.org/read.php?2,219896,219896#msg-219896)**
>
> My maintenance mode config is as follows : if (-f $errorroot/maintenance.html) { return 503; } error\_page 503 @maintenance; location @maintenance { rewrite ^(.\*)$ /maintenance.html break; pro
