Welcome! Log In Create A New Profile

Advanced

Nginx Redirect

Posted by chrisjnas 
Nginx Redirect
November 10, 2012 05:48PM
Hey all,

I'm new to nginx and am trying to figure out an issue with redirection. I'm trying to redirect a website from a host running a web application to another domain. That part I've done but I'm looking to mask it. When it redirects, I don't want the user to know they've gone to another domain.

I've substituted the domain names for privacy of my client. But, they are on a Linode at test.com that's running a web application that's at sub.test.com. All I want is for any user visiting test.com to be redirected to a temporary site hosted on other.com but without exposing the domain.

Previously, someone had shown me how to do it but it was a long time ago and I no longer have the information to reference. Can someone help me out? I don't want to expose the domain of the testing environment.

server {
listen 80;
server_name www.test.com test.com www.test.net test.net;

rewrite ^ http://other.com/sub permanent;

#location / {
# root /srv/http/www.test.com;
# index index.html;
#}
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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