Web server on Azure VM











up vote
0
down vote

favorite












I've installed a Windows 2012 R2 VM (free tier) and enabled all ports for external communication (including port 80).



I logged in to my VM and installed nginx webserver (I've also tried to python development server).



I can access the website internally on the VM (using 127.0.0.1 or the internal address of the server 10.1....) but when trying to access it from outside, using the external IP address (which is also the IP address I used in order to login to my server using RDP) I get no response.



Can you please help me understand what I'm doing wrong?



Thanks!










share|improve this question
























  • Did you create inbound rules for the VM (this isn't a setting inside the vm; you can get to the inbound and outbound rules via the portal or CLI)? Without opening up additional ports this way, you'll only have the RDP port open by default.
    – David Makogon
    Nov 10 at 11:26












  • Yes i did create it. I enabled RDP, SSH, HTTP and HTTPS
    – Matan
    Nov 10 at 11:57










  • Check the interface binding of your nginx server to see if it is allowing external connections.
    – Zair Henrique
    Nov 10 at 15:12










  • I did not find anything says differently. BTW, I did exactly the same on an ubuntu VM and it works... The question is what different on Windows.
    – Matan
    Nov 10 at 15:20








  • 2




    The Windows Firewall is what's different on Windows. Poke a hole for 80/TCP.
    – evilSnobu
    Nov 10 at 17:24















up vote
0
down vote

favorite












I've installed a Windows 2012 R2 VM (free tier) and enabled all ports for external communication (including port 80).



I logged in to my VM and installed nginx webserver (I've also tried to python development server).



I can access the website internally on the VM (using 127.0.0.1 or the internal address of the server 10.1....) but when trying to access it from outside, using the external IP address (which is also the IP address I used in order to login to my server using RDP) I get no response.



Can you please help me understand what I'm doing wrong?



Thanks!










share|improve this question
























  • Did you create inbound rules for the VM (this isn't a setting inside the vm; you can get to the inbound and outbound rules via the portal or CLI)? Without opening up additional ports this way, you'll only have the RDP port open by default.
    – David Makogon
    Nov 10 at 11:26












  • Yes i did create it. I enabled RDP, SSH, HTTP and HTTPS
    – Matan
    Nov 10 at 11:57










  • Check the interface binding of your nginx server to see if it is allowing external connections.
    – Zair Henrique
    Nov 10 at 15:12










  • I did not find anything says differently. BTW, I did exactly the same on an ubuntu VM and it works... The question is what different on Windows.
    – Matan
    Nov 10 at 15:20








  • 2




    The Windows Firewall is what's different on Windows. Poke a hole for 80/TCP.
    – evilSnobu
    Nov 10 at 17:24













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I've installed a Windows 2012 R2 VM (free tier) and enabled all ports for external communication (including port 80).



I logged in to my VM and installed nginx webserver (I've also tried to python development server).



I can access the website internally on the VM (using 127.0.0.1 or the internal address of the server 10.1....) but when trying to access it from outside, using the external IP address (which is also the IP address I used in order to login to my server using RDP) I get no response.



Can you please help me understand what I'm doing wrong?



Thanks!










share|improve this question















I've installed a Windows 2012 R2 VM (free tier) and enabled all ports for external communication (including port 80).



I logged in to my VM and installed nginx webserver (I've also tried to python development server).



I can access the website internally on the VM (using 127.0.0.1 or the internal address of the server 10.1....) but when trying to access it from outside, using the external IP address (which is also the IP address I used in order to login to my server using RDP) I get no response.



Can you please help me understand what I'm doing wrong?



Thanks!







azure web nginx azure-virtual-machine






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 5 at 13:33

























asked Nov 10 at 9:50









Matan

3801920




3801920












  • Did you create inbound rules for the VM (this isn't a setting inside the vm; you can get to the inbound and outbound rules via the portal or CLI)? Without opening up additional ports this way, you'll only have the RDP port open by default.
    – David Makogon
    Nov 10 at 11:26












  • Yes i did create it. I enabled RDP, SSH, HTTP and HTTPS
    – Matan
    Nov 10 at 11:57










  • Check the interface binding of your nginx server to see if it is allowing external connections.
    – Zair Henrique
    Nov 10 at 15:12










  • I did not find anything says differently. BTW, I did exactly the same on an ubuntu VM and it works... The question is what different on Windows.
    – Matan
    Nov 10 at 15:20








  • 2




    The Windows Firewall is what's different on Windows. Poke a hole for 80/TCP.
    – evilSnobu
    Nov 10 at 17:24


















  • Did you create inbound rules for the VM (this isn't a setting inside the vm; you can get to the inbound and outbound rules via the portal or CLI)? Without opening up additional ports this way, you'll only have the RDP port open by default.
    – David Makogon
    Nov 10 at 11:26












  • Yes i did create it. I enabled RDP, SSH, HTTP and HTTPS
    – Matan
    Nov 10 at 11:57










  • Check the interface binding of your nginx server to see if it is allowing external connections.
    – Zair Henrique
    Nov 10 at 15:12










  • I did not find anything says differently. BTW, I did exactly the same on an ubuntu VM and it works... The question is what different on Windows.
    – Matan
    Nov 10 at 15:20








  • 2




    The Windows Firewall is what's different on Windows. Poke a hole for 80/TCP.
    – evilSnobu
    Nov 10 at 17:24
















Did you create inbound rules for the VM (this isn't a setting inside the vm; you can get to the inbound and outbound rules via the portal or CLI)? Without opening up additional ports this way, you'll only have the RDP port open by default.
– David Makogon
Nov 10 at 11:26






Did you create inbound rules for the VM (this isn't a setting inside the vm; you can get to the inbound and outbound rules via the portal or CLI)? Without opening up additional ports this way, you'll only have the RDP port open by default.
– David Makogon
Nov 10 at 11:26














Yes i did create it. I enabled RDP, SSH, HTTP and HTTPS
– Matan
Nov 10 at 11:57




Yes i did create it. I enabled RDP, SSH, HTTP and HTTPS
– Matan
Nov 10 at 11:57












Check the interface binding of your nginx server to see if it is allowing external connections.
– Zair Henrique
Nov 10 at 15:12




Check the interface binding of your nginx server to see if it is allowing external connections.
– Zair Henrique
Nov 10 at 15:12












I did not find anything says differently. BTW, I did exactly the same on an ubuntu VM and it works... The question is what different on Windows.
– Matan
Nov 10 at 15:20






I did not find anything says differently. BTW, I did exactly the same on an ubuntu VM and it works... The question is what different on Windows.
– Matan
Nov 10 at 15:20






2




2




The Windows Firewall is what's different on Windows. Poke a hole for 80/TCP.
– evilSnobu
Nov 10 at 17:24




The Windows Firewall is what's different on Windows. Poke a hole for 80/TCP.
– evilSnobu
Nov 10 at 17:24












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










As @evilSnobu points out from his comments, the short answer is to allow the TCP port 80 in the windows firewall on windows VM itself.



Usually, we could login to that Windows VM and run the CMD command netsh advfirewall set allprofiles state off to disable the windows firewall temporarily. Then we can use telnet tool to check if TCP 80 port can be connected.



When we face the same issue no response outside of Azure VM. we can try one or more of the followings:




  • There is an NSG at the subnet level or NIC level as well which is not allowing data through.

  • There is a firewall on the VM itself (windows firewall etc.)

  • There is nothing listening on that port. It should be listening on 0.0.0.0 instead of 127.0.0.1 when you use netstat -ano in the windows CMD.

  • The service is not staring when you verify the port listening.

  • Outbound traffic with a specific port is denied from your local machines.


Hope this helps.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237785%2fweb-server-on-azure-vm%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    As @evilSnobu points out from his comments, the short answer is to allow the TCP port 80 in the windows firewall on windows VM itself.



    Usually, we could login to that Windows VM and run the CMD command netsh advfirewall set allprofiles state off to disable the windows firewall temporarily. Then we can use telnet tool to check if TCP 80 port can be connected.



    When we face the same issue no response outside of Azure VM. we can try one or more of the followings:




    • There is an NSG at the subnet level or NIC level as well which is not allowing data through.

    • There is a firewall on the VM itself (windows firewall etc.)

    • There is nothing listening on that port. It should be listening on 0.0.0.0 instead of 127.0.0.1 when you use netstat -ano in the windows CMD.

    • The service is not staring when you verify the port listening.

    • Outbound traffic with a specific port is denied from your local machines.


    Hope this helps.






    share|improve this answer



























      up vote
      0
      down vote



      accepted










      As @evilSnobu points out from his comments, the short answer is to allow the TCP port 80 in the windows firewall on windows VM itself.



      Usually, we could login to that Windows VM and run the CMD command netsh advfirewall set allprofiles state off to disable the windows firewall temporarily. Then we can use telnet tool to check if TCP 80 port can be connected.



      When we face the same issue no response outside of Azure VM. we can try one or more of the followings:




      • There is an NSG at the subnet level or NIC level as well which is not allowing data through.

      • There is a firewall on the VM itself (windows firewall etc.)

      • There is nothing listening on that port. It should be listening on 0.0.0.0 instead of 127.0.0.1 when you use netstat -ano in the windows CMD.

      • The service is not staring when you verify the port listening.

      • Outbound traffic with a specific port is denied from your local machines.


      Hope this helps.






      share|improve this answer

























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        As @evilSnobu points out from his comments, the short answer is to allow the TCP port 80 in the windows firewall on windows VM itself.



        Usually, we could login to that Windows VM and run the CMD command netsh advfirewall set allprofiles state off to disable the windows firewall temporarily. Then we can use telnet tool to check if TCP 80 port can be connected.



        When we face the same issue no response outside of Azure VM. we can try one or more of the followings:




        • There is an NSG at the subnet level or NIC level as well which is not allowing data through.

        • There is a firewall on the VM itself (windows firewall etc.)

        • There is nothing listening on that port. It should be listening on 0.0.0.0 instead of 127.0.0.1 when you use netstat -ano in the windows CMD.

        • The service is not staring when you verify the port listening.

        • Outbound traffic with a specific port is denied from your local machines.


        Hope this helps.






        share|improve this answer














        As @evilSnobu points out from his comments, the short answer is to allow the TCP port 80 in the windows firewall on windows VM itself.



        Usually, we could login to that Windows VM and run the CMD command netsh advfirewall set allprofiles state off to disable the windows firewall temporarily. Then we can use telnet tool to check if TCP 80 port can be connected.



        When we face the same issue no response outside of Azure VM. we can try one or more of the followings:




        • There is an NSG at the subnet level or NIC level as well which is not allowing data through.

        • There is a firewall on the VM itself (windows firewall etc.)

        • There is nothing listening on that port. It should be listening on 0.0.0.0 instead of 127.0.0.1 when you use netstat -ano in the windows CMD.

        • The service is not staring when you verify the port listening.

        • Outbound traffic with a specific port is denied from your local machines.


        Hope this helps.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 13 at 9:02

























        answered Nov 11 at 3:07









        Nancy Xiong

        2,258116




        2,258116






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237785%2fweb-server-on-azure-vm%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini