Home > database >  Bad Request - Invalid Hostname when accessing localhost using IP address
Bad Request - Invalid Hostname when accessing localhost using IP address

Time:03-02

I'm using Visual Studio and IIS Express to run a web app locally. I can access the web app without any issues using https://localhost:44300.

Out of curiosity, I wanted to access it using the IP address, so I tried https://10.1.1.229:44300 but am getting this error:

enter image description here

I thought I could replace localhost with my private IP address which I got from ipconfig: enter image description here

I also noticed it says the certificate is not secure.

How can I access my local web app using the IP address?

CodePudding user response:

You can try the following settings to ~\Documents\IISExpress\config\applicationhost.config' file.

<binding protocol="http" bindingInformation="ip address:port:host header" />
  • Related