Glam Prestige Journal

Bright entertainment trends with youth appeal.

I want to run a service on a custom port (e.g. jenkins on 8080) and I prefer to access it via browser with a name I can remember, e.g. which will be an alias for

  1. Is such a thing possible?
  2. If so, will it be only an HTTP thing, or all network protocols will know of this alias?
  3. Also, if (1) is true, is this feature supported on other OS (centos, windows, etc.)

Edit:

  1. What are the moving parts from the moment I type in address until it gets resolved? I'm guessing that the browser parsers, and therefore there might be a browser that supports my request. After that, the parsed url is probably passed to an OS process which in turn can also implement my request and accept str instead of an int... Are any of these parts configurable in a such a way that it will answer my need?
4

4 Answers

This can be solved with "reverse proxying" - so research into this field a bit.

It can't do what you're actually asking (alias a port number), but it can give you another way to make an easy path for each service (by forwarding DNS records to a specific IP and port).

Basically, what you can do with a reverse proxy is:

  • Ensure all your sites present an SSL certificate, and (if you choose) enforce HTTPS in this case
  • Map to (port forward)
  • Map to (location forward)

The above works with both internal and external DNS resolving

I'm personally using Nginx Proxy Manager, but Traefik is also a popular choice.

To get an idea what to setup, Nginx Proxy Manager looks like this:

enter image description here

5

From rfc 1738

port in the url is a number

port The port number to connect to. Most schemes designate protocols that have a default port number. Another port number may optionally be supplied, in decimal, separated from the host by a colon. If the port is omitted, the colon is as well.

It is possible to use solutions such as Nginx, Apache, squid, lighthttpd, etc. Do note that these will map your port to whatever name you give but it will be something independent from the internal localhost. You can use this software in Linux and window based systems.

Here's an apache example.

Listen IP_ADDR:80
NameVirtualHost IP_ADDR:80
<VirtualHost IP_ADDR:80> ServerName yourname.yourdomain ProxyPass / ProxyPassReverse /
</VirtualHost>

Another solution, if you wish to keep the servers memorable, is to give Jenkins a different IP all together by running it on a different server and then mapping it in /etc/hosts as 192.168.1.1 Jenkins (You basically add this in the file). After doing this let us say your Jenkins is running on 192.168.1.1:3000 you can access it by .

Even if you do this, all network protocols won't work, you won't be able to access Jenkins using .

Hope this helps!!

2

Probably the simplest solution is to use redir to redirect the ports, e.g. run redir :80 127.0.0.1:8080, or even better put it into your inetd.conf. If you do not like the traffic going wastefully through another process, the same can be achieved using iptables forwarding (but that is more hassle).

True way of creating an alias would be to use a SRV record in your DNS server and that would work well with no overhead, but because of history, SRV records are ignored for the http/https protocol.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy