Cannot access domain name with port number in IIS - web

I've set up a new site in IIS. I can access it via IP, but can't via a specific domain.
192.168.1.100:8001 is working
test.test:8001 is not

I think you should add this test.test to your hosts file. The hosts file for Windows is located in C:\Windows\System32\Drivers\etc\hosts. Try to add your domain pointing to 127.0.0.1 like:
127.0.0.1 test.test

Related

proxying outgoing traffic from local network

i have the following case: i've had an app hosted on some cloud hoster's server and it's own domain, now i've migrated from cloud to selfhosted and what i want to do is to redirect all users in my local network from the old domain to the new one i.e. when a user tipes previous url into it's browser it opens new urk. The main problem is that i can't influence on the old domain, but can configure my local proxy server apache.
There are 2 ways to achieve that:
The simplest way is to edit the hosts file on your local network computers (on windows you can find it in c:\Windows\System32\Drivers\etc\hosts (or /etc/hosts on Linux) and add the entry for your olddomain internalserverip like "IP_ADDRESS DOMAIN_NAME www.DOMAIN_NAME".
You will need to create a bind server on your local network to answers the local queries and configure the zone for your old domain like you would when the domain was hosted on cloud, you just need to put your internal server IP in the A entries.
In both situations if your web server is configured with only the new vhost entry , you will need to configure it with the old vhost (if there is no vhost configure you will not need to do anything)

Access IIS https website from outside network

Currently I have a https website setup locally on the Azure VM
with a custom hostname : <websitename>.<domainname>.com and bound to the localhost 127.0.0.2
in the hosts.etc on port 443
Consider example hostname as web.microsoft.com
Website bindings in IIS are
type:https
hostname:web.microsoft.com
port:443
IP Address:127.0.0.2
Hosts.etc
127.0.0.2 web.microsoft.com
In order to access it locally on the VM itself https://web.microsoft.com/admin/login.aspx works fine.
Port 443 is open on the Azure VM and inbound firewall rule is set in windows to allow connections on 443
If I try to access it outside of the network using the public IP address this doesn't work
eg https://45.60.200.110/admin/login.aspx.
I have other non-https websites which work fine and can be accessed through the public IP ,only difference is they are not having hostname in the IIS website bindings.
Am I missing something or do I need to make some additional config?
That's the problem.
The customized hostname cannot be accessed through the external network. Because the public network does not know this hostname, nor does it bind the hostname to your IP.
For example, you can enter other custom host names at will in the browser, and you will find the same error displayed.
The solution is that you need to purchase an available public domain name from the domain name provider and bind it to IP address.
If you insist on using custom domain name, it can only be used on the internal network. In addition to the configuration made on the server side, it is also need to add the host name and IP address in the hosts file of the client machine.
45.60.200.110 web.microsoft.com

localtest.me’s server IP address could not be found

I've attempted to set up a test binding through IIS to localtest.me, but it's not resolving to my local IP address. My understanding of localtest.me is that it should resolve automatically. In Chrome is get the error message:
blog-test.localtest.me’s server IP address could not be found.
And when pinging blog-test.localtest.me I get the following error:
Ping request could not find host blog-test.localtest.me. Please check the name and try again.
In IIS I have a site that's bound to blog-test.localtest.me with the following settings:
Everything I've read online advises that localtest.me should resolve automatically? Is this the case or is there setup step I'm missing?
You can simply add this entry in your host file locally, and it will work.
On windows machine - C:\Windows\System32\drivers\etc\hosts
On *nix machine - /etc/hosts
It sounds like you didn't register the domain in either DNS or hosts file.
1.So if you are in an AD environment, please add a CNAME blog-test.localtest.me in your local DNS Forward lookup zone.
2.If you are going to access the website from public domain, then please purchase the domian from domain provider and point it to Server's public IP.
3.If you just want to access the website locally, please add the domain to hosts file.
The hosts record would looks like:
127.0.0.1 blog-test.localtest.me

Invalid Host header when trying to connect reactjs and domain name

I'm trying to deploy a JS app (back in nodejs, front in reactjs) on a hosting server. I've dockerized everything (back, front and database) and everything works well, I can access my app through the IP address of the server.
Now I'm trying to setup a domain name to point to my app.
I've a Invalid Host header when I try to access from domain name (while still working accessing through server's IP address).
I've tried to add a HOST:mydomain.com to the .env of my reactjs app but I got this error Could not find an open port at mydomain.com
Would love if someone can help me through this :)
Given app works by IP, you can leave config of app as is. Do not add HOST or any other config.
IP to name mapping is done using DNS. So made DNS registration in DNS zone like this
mydomain.com A <IP address of app>
Where A is DNS entry type. Or made request to provider to register A entry type for you.
For testing purposes you may do mapping on any Windows PS using hosts file C:\Windows\System32\drivers\etc\hosts where mapping is done by
<IP address of app> mydomain.com
hosts works on one PC only.
After adding to hosts or to DNS try ping mydomain.com to make sure that name is resolved to correct IP address.
Mapping on web server is done when one web server hosts several different sites on one IP. But when you use Docker it's best to have one Docker container for one service.

Access domain name via local IP

I've setup a local server but I cannot remember how to access specific domains through a single IP, example:
I have the domain setup in hosts as:
127.0.0.1 zf2-tutorial.localhost localhost
127.0.0.1 DomainA
127.0.0.1 DomainB
Now when I access my local server through my ip address of: 172.16.20.35 it comes up at the first domain zf2.
I'm trying to access DomainA through local IP, can anyone tell me how to do this with a browser?
I've tried 172.16.20.35:DomainA, 172.16.20.35.DomainA, 172.16.20.35/DomainA.

Resources