Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There is a requirement where clients should not know the port on which a particular service is running in the server.

Written a firewall script to redirect the port, where user will see some different port. e.g


here ip1 and ip2 are clients ip. PortB and PortD are original port. But client can see portA and portC

But when client typed https://server_ip:portA/some_service The url got changed to https://server_ip:portB/some_service

The actual port got display during access, that is what we are trying to prevent. netstat command is displaying portA and portC at the client's space. So from netstat commnd client wont be knowing the actual port number, but accessing the url is revealing the actual port number. Now changing url is not in the scope of the script. How to prevent showing actual port.

share|improve this question

migrated from Oct 26 '11 at 14:06

This question came from our site for professional and enthusiast programmers.

The webserver must have sent a redirect, and used the hostname and port which it is configured with. You need to reconfigure your webserver to use the contents of the Host header sent by the client instead.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.