Coder Perfect

Is it possible to use /etc/hosts to map both a hostname and a port? [closed]


Can I map an IP address like to a domain name and a port?

For example, I would like to map to

Asked by Carson

Solution #1

No, that’s not going to work. The port has no meaning in the hosts-file because it is not part of the hostname.

Answered by mata

Solution #2

Use a reverse proxy if you truly need to accomplish this. For instance, consider Nginx:

server {
  location / {

Answered by Eric Fortis

Post is based on