By NormalizeWeb
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!
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!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.