Question

How to remove the SSL configured URL domain temporarily

Hello Team,

I have three configured ssl URLs for my domain like abcd.com, www.abcd.com & alpha.abcd.com. Everything works fine and all three urls are encrypted using lets encrypt. Now I would like temporarily block the access to abcd.com and www.abcd.com. Just keep alpha.abcd.com. How do I achieve this.

I have followed this tutorial for configuring SSL https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-14-04

Please let me know. Thank you in advance.


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.

Accepted Answer

Hi!

You can disable access to these domains by editing each one’s nginx server block and adding the following block after server_name, listen, and ssl_*.

server {
    ....
    location / {
        deny all;
    }
    ....
}

This will cause nginx to return a 403 Forbidden error on every part of the domains. If each domain has separate http and https server blocks, you will want to update both. Make sure you reload or restart nginx afterwards so that the changes take effect!

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.