redirect domain to another site's subdomain

April 3, 2018 1.8k views
DNS Ubuntu 16.04

Hello Oceaners,

My client have and want to use my website builder system.
My domain is

I need to redirect to By the way I use nginx. What DNS records and rewrite rules I must use?


2 Answers
jasonjpeters April 3, 2018
Accepted Answer
server {
   listen 80;


   return 301 $scheme://$request_uri;

by Justin Ellingwood
HTTP redirects are used to redirect web site visitors to new locations when they request content. These are useful for a variety of reasons, whether permanent or temporary. This guide will demonstrate how to redirect visitors using Apache and Nginx.

If is configured in nginx to use as another domain then you will just need your client to point their domain name to your server’s IP address or create a CNAME record to point it to

Basically, on your end you’ll want to modify the line in your server block (in /etc/nginx/sites-enabled/) from:




Then restart nginx with service nginx restart

Your server will now be ready to accept requests for once your client’s DNS is updated.

Have another answer? Share your knowledge.