Report this

What is the reason for this report?

How to remove the SSL configured URL domain temporarily

Posted on August 23, 2016

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.



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!

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.

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!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.