I am using httpd server for load balancing and as web server. I want to convert my request from : http://hostname:port/service to http://hostname/service How it can be done using RewriteRule or any other technique ?
:port comes from the URI scheme (RFC 3986, 3) Syntax Components:
foo://example.com:8042/over/there?name=ferret#nose \_/ \______________/\_________/ \_________/ \__/ | | | | | scheme authority path query fragment
The port subcomponent of authority is designated by an optional port number in decimal following the host and delimited from it by a single colon (
port = *DIGIT
A scheme may define a default port. For example, the
httpscheme defines a default port of
80, corresponding to its reserved TCP port number. The type of port designated by the port number (e.g., TCP, UDP, SCTP) is defined by the URI scheme. URI producers and normalizers should omit the port component and its ":" delimiter if port is empty or if its value would be the same as that of the scheme's default.
- for any other port the port is visible in the URL.
If you have a web service e.g. on
http://example.com:8080/service and you would like to use a different web server (e.g. as a load balancer) on
http://example.com/service, you'd need a reverse proxy on the web server listening on port
80. In Apache it's done with module mod_proxy:
<Location "/service"> ProxyPass "http://example.com:8080/service" </Location>