IISExpress returns a 503 error from remote machine

2020-01-25 12:11发布

I'm attempting to test a website I have running in a local IISExpress instance with some other machines / devices on my local network. I am running Win7 Pro.

When I first attempt to browse to my machine from another machine on my local network segment, I get a 400 error: Hostname is invalid.

I understand that I need to grant remote access to the ACL with a command on the elevated command prompt like:

netsh http add urlacl url=http://mymachinename:50333/ user=everyone

Now I get a 503 service is unavailable error.

Windows Firewall is currently shut off, and I am able to browse my local IISExpress instance with the address http://localhost:50333

What is the final piece to this configuration puzzle?

标签: iis-express
10条回答
爷的心禁止访问
2楼-- · 2020-01-25 12:58

It looks like you are missing a binding information entry in applicationhost.config file.

  1. Open your applicationhost.config file. Possible locations are:

    • %userprofile%\Documents\IISExpress\config\applicationhost.config
    • $(solutionDir)\.vs\config\applicationhost.config (VS2015)
    • Failing that, inspect the output from iisexpress.exe to be sure.
  2. Locate your WebSite entry and add following binding with your machine name.

         <binding protocol="http" bindingInformation=":50333:your-machine-name" />
    
  3. Restart IIS Express

查看更多
Rolldiameter
3楼-- · 2020-01-25 12:58

Nothing worked for me. Finally I found iisexpress-proxy

See my answer https://stackoverflow.com/a/33623399/631527

Another solution is ngrok

查看更多
Anthone
4楼-- · 2020-01-25 13:01

After wasting more than 3h on such a full subject I decided to share my setup with you. My configuration is Visual Express 2012 for Web update 4 on windows 8. This was my first come back to MS VS since studies (at least 8 years) and now I'm sure that linux rules. On django this kind of setup took me 10min of searching documentation.

  1. turn off firewall for testing

    netsh advfirewall set allprofiles state off
    
  2. setup bindings in my case local address is localIP=192.168.1.102 (because links can not contain nonnumeric domain, use it below instead of mylocaldomain.com, see stackoverflow policy) in Documents\IISExpress\config\applicationhost.config

    <bindings>
        <binding protocol="http" bindingInformation="*:53351:mylocaldomain.com" />
        <binding protocol="http" bindingInformation="*:53351:localhost" />
    </bindings>
    
  3. add autorun for ISS Express start service automatically

    <site name="NeuronCharts" id="2" serverAutoStart="true">
    
  4. Add some weird rules to http server (I still do not know if this is nesseary)

    netsh http add urlacl url=http://mylocaldomain.com:53351/ user=everyone
    
  5. run IISExpress manually not from VS IDE

  6. you will see that ISSExpress is registering bindings
  7. run browser http://mylocaldomain.com:53351 if it is working then we can add firewall rule
  8. add firewall rule

    netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=53351 remoteip=any action=allow
    

set remoteip to any if you want to access you server from outside world if you want to access for local network use localsubnet

  1. start firewall

    netsh advfirewall set allprofiles state on
    
  2. check again if everything is working on local and public ip

Wish you luck

Rafal

查看更多
该账号已被封号
5楼-- · 2020-01-25 13:04

Regarding Anthony Rizzolo's answer: in Windows 8.1, I had to type like this:

netsh http delete urlacl url=<the url from the list>

For example:

netsh http delete urlacl url=http://+:8689/
查看更多
登录 后发表回答