How to remove the SSL configured URL domain temporarily

August 23, 2016 238 views
Nginx Node.js Ubuntu 16.04

Hello Team,

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

I have followed this tutorial for configuring SSL

Please let me know. Thank you in advance.

1 Answer
kamaln7 MOD August 23, 2016
Accepted Answer


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!

  • Hello Kamal, thanks for reverting. Currently I have only one server block which listens on 80 and another server block listening on 443 which has all three urls mentioned.

    Do you mean that I should create the two different server blocks for each domain and put your above code block in the location section ?

    Let me know. Thank you in advance.

  • You are champ Kamal. Just added another block of server mentioning two server_name (urls) which I wanted to restrict and it worked. Awesome thank you Kamal for your answer.

    Cheers !

Have another answer? Share your knowledge.