Welcome! Log In Create A New Profile

Advanced

redirect to external url or static page

Posted by Ramage 
redirect to external url or static page
November 11, 2013 09:31AM
Hi all,

We are running Nginx as a proxy in front of a multi-tenant app hosted on IIS. When one of the tenants is down for maintenance I would like to redirect the url to a static web page hosted on AWS S3 or a local static page on the Nginx server.

For example the url may be http://demo.myapp.com, so would want demo to be redirected but anything else such as http://test.myapp.com to function as normal through the proxy pass to the back end web servers.

I have tried using rewrite / return in a new server block setting the server name to demo.myapp.com and this works redirecting to a static page but it redirects all not just demo.

All the traffic goes to port 80 on the Nginx server and the default location / then proxy to the back end web servers.

Looking for any advice on this as I am new to Nginx and cannot find an answer.

Thanks in advance.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 281
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