How to remove the SSL configured URL domain temporarily

Posted August 23, 2016 4.5k views
NginxNode.jsUbuntu 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.

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.

Submit an Answer
1 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 !