Welcome! Log In Create A New Profile

Advanced

redirection of websites

Posted by jepoytengco 
redirection of websites
June 28, 2016 05:04AM
Hi, we have some websites that we would like nginx service to redirect them to an alternative website. everything's setup properly like we've created a cname redirecting to a different website which is setup in nginx as well.

When I ping the website (suppose to be redirected), it detects the nginx server IP, so meaning to say, it is resolving using the nginx server or nginx redirection server. but for some reason it doesn't reaches the alternate website.

Regards,
Thanks
Re: redirection of websites
July 19, 2016 04:02PM
Instead of using cname records use A records and add the following code within your Nginx configuration file:

return 301 https://yourwebsite.com$request_uri;
or
return 301 http://yourwebsite.com$request_uri;

Does this make sense?



Edited 1 time(s). Last edit at 07/19/2016 04:03PM by schnappi.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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