Access nginx for testing while in maintenance

I have this setup: nginx => haproxy => thin( a ruby http server )
when in maintenance mode(serving a maintenance page to end users), how
can I still access the web server so that I can do some testing first?

I want to be able to access the server via the same domain.

maybe set some magic cookie? or pass through requests from a particular
IP? Any idea?

Yaxm Y. wrote:

I have this setup: nginx => haproxy => thin( a ruby http server )
when in maintenance mode(serving a maintenance page to end users), how
can I still access the web server so that I can do some testing first?

I want to be able to access the server via the same domain.

maybe set some magic cookie? or pass through requests from a particular
IP? Any idea?

You can set nginx to listen on another port. Something like:

server {
server_name your-server.com;
listen 80;
location / {
try_files maintenance.html $uri $uri/ 404.html;

}
}

server {
server_name your-server.com;
listen 8080;
location / {
try_files $uri $uri/ 404.html;

}
}

and connect via http://your-server.com:8080/ .

You can make it a more random port so your users won’t guess it.

Jim