How to enable external request on IIS Express

If you put to your browser URL address which contains different server name/IP address then localhost. You will see error „Bad Request – Invalid Hostname“ or information that page is not accessible. There are workaround how can you connect to your IIS Express from different computer in network.

iisExpress

[wp_ad_camp_1]

Configure IIS Express

  1. Go to the folder „..\My Documents\IISExpress\config\“ in your home
  2. Open file „applicationhost.config“ in your favorite text editor
  3. Find lines (port number can be different)
     <bindings>
         <binding protocol="http" bindingInformation="*:50280:localhost" />
     </bindings>
  4. Rewrite localhost to *
  5. Lines should look like
    <bindings>
         <binding protocol="http" bindingInformation="*:50280:*" />
    </bindings>
  6. Save file and restart IIS Express

Reserve IIS Express URL for non-administrator accounts

  1. Run command line as Administrator
  2. Run command (modify port number by your IIS Express listening port)
    netsh http add urlacl url=http://*:50280/ user=everyone

Enable port on firewall

  1. Go to the „Control Panel\System and Security\Windows Firewall“
  2. Click „Advanced settings“
  3. Select „Inbound Rules“
  4. Click on „New Rule …“ button
  5. Select „Port“, click „Next“
  6. Fill your IIS Express listening port number (in my case 50280), click „Next“
  7. Select „Allow the connection“, click „Next“
  8. Check where you would like allow connection to IIS Express (Domain, Private, Public), click „Next“
  9. Fill rule name (e.g „IIS Express), click „Finish“

[wp_ad_camp_1]

Napsat komentář

Vaše emailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *