Basj Basj - 10 months ago 57
Apache Configuration Question

DNS record with different ports

I have a very cheap VPS with the IP
which listens on these ports: 7000, 7001, ... 7020. Apache listens on port 7010. Then I can access my website with

As this is a shared IP, I cannot listen on port 80 myself with my VPS: I only have access to 7000 ... 7020.

I have registered a domain
by a domain provider and I'm using their nameservers.

How to set up the DNS records such that any user going on will be transparantly directed to my website, with Apache ? (the browser will probably default to port 80, is that right?)

I initially thought about such a DNS record:

Name TTL Type Priority Content
* 3600 A 0

but then, I think I would have to access the website with (which is not nice) and not (which would be better).

Answer Source

Unfortunately you cannot specify ports on DNS records. The only way to make it work as you expect is to have a reverse proxy running elsewhere (nginx, haproxy), listening on port 80, and then forward traffic to your server.

Some useful information about HTTP proxying with nginx: