简体   繁体   中英

Accessing IIS Express hosted website remotely on Azure VM

I have Visual Studio solution running in Debug mode using IIS Express on an Azure Virtual Machine.

I can RDP into this machine using its domain:

myapp.cloudapp.net:port#

IIS Express is running:

localhost:2799

I have also created an End Point using HTTP, mapping public port 80 to 2799.

But the URL http://myapp.cloudapp.net does not connect or relay through to the webpage running at localhost:2799. Is there something else that needs to be done to make this happen?

I believe that the only thing you need to modify - is to add new rule in your firewall to open port 2799. Try to disable firewall and check whether the website available. If the page is shown - add appropriate rules to firewall.

There are three changes you might need to make.

1.Tell IIS Express itself to bind to all ip addresses and hostnames. In your .config file (typically %userprofile%\\My Documents\\IISExpress\\config\\applicationhost.config, or $(solutionDir).vs\\config\\applicationhost.config for Visual Studio 2015), find your site's binding element, and add :

   <binding protocol="http" bindingInformation="*:2799:*" />

2. Setup the bit of Windows called 'http.sys'. As an administrator, run the command:

   netsh http add urlacl url=http://*:2799/ user=everyone
  1. Allow IIS Express through Windows firewall. Start / Windows Firewall with Advanced Security / Inbound Rules / New Rule... Program %ProgramFiles%\\IIS Express\\iisexpress.exe OR Port 2799 TCP

Now when you start iisexpress.exe you should see a message such as

Successfully registered URL "http://*:2799/" for site "myapp" application "/" 

This configuration combined with your endpoint mapping should do the trick Hope this helps Best regards Stéphane

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM