Welcome! Log In Create A New Profile

Advanced

Re: access nginx for testing while in maintenance

June 30, 2009 03:37PM
Yaxm Yaxm 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
Subject Author Posted

access nginx for testing while in maintenance

Yaxm Yaxm June 30, 2009 03:18PM

Re: access nginx for testing while in maintenance

Jim Ohlstein June 30, 2009 03:37PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 138
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready