Question

nginx cname redirect to other site setup

I have a website which uses an affiliate program. Also, I am using ssl certificate and nginx using let us encrypt. I need to redirect the subdomain “service.mydomain.com” to affiliate.com. The Affiliate provider supports URL masking, and based on their tutorial I need to add a CNAME record (name,value ) as (service, cname.affilate.com). Wen I have added this record I got an ssl certificate error because “service” subdomain does not have an ssl certificate. So I have removed the CNAME record and added an A record to expand ssl certificate. Then I tried to add cname record again, but CNAME record can not have the same name as an A record. my question is how o configure this using nginx, letus encrypt and CANME?. I am lost and I am not able to track how this should work.

Regards


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It the affiliate program offers a CNAME based solution this would not be a redirect since redirection is not done by DNS, only aliasing. If you point a name to the name they provide and their server does not have an SSL certificate that supports your domain then this will happen. I would recommend reaching out to the provider to get more information on best-practices with their recommended configuration.