If you decide to use a custom port for the HTTP Reverse Proxy (rhttpproxy) on vCenter Server which uses port 80 (HTTP) and 443 (HTTPS) by default, you should also apply the same change on all ESXi hosts being managed by that vCenter Server for proper functionality. The configuration files for the rhttpproxy has since changed from the early days of vSphere 5.x and in vSphere 6.x, there are now different.
UPDATE (04/27/18) - With release of vSphere 6.7, VMware now officially supports customizing the Reverse HTTP(s) Ports on the VCSA. Below is a screenshot using the VCSA Installer UI and this can also be customized in the JSON configuration file using the VCSA CLI Installer for automation purposes.
Below are the instructions for modifying the default ports for rhttproxy service for both Windows vCenter Server, vCenter Server Appliance (VCSA) and ESXi host.
Note: If you change the default ports of your vCenter Server, you will need to ensure that all VMware/3rd Party products that communicate with vCenter Server are also modified.
vCenter Server for Windows
On Windows, you will need to modify C:\ProgramData\VMware\vCenterServer\cfg\vmware-rhttpproxy\config.xml and look for the following lines to change either the HTTP and/or HTTPs ports:
<httpPort>80</httpPort>
<httpsPort>443</httpsPort>
Once you have saved the changes, you will need to restart the VMware HTTP Reverse Proxy service using Windows Services Manager.
vCenter Server Appliance (VCSA)
On the VCSA, you will need to modify /etc/vmware-rhttpproxy/config.xml and look for the following lines to change either the HTTP and/or HTTPs ports:
<httpPort>80</httpPort>
<httpsPort>443</httpsPort>
Once you have saved the changes, you will need to restart the rhttpproxy service by running the following command:
/etc/init.d/rhttpproxy restart
ESXi
Disclaimer: VMware does not officially support modifying the default HTTP/HTTPS ports on an ESXi host.
Pre-ESXi 8.0 - Use the following instructions:
On ESXi, you will need to modify /etc/vmware/rhttpproxy/config.xml and look for the following lines to change either the HTTP and/or HTTPs ports:
<httpPort>80</httpPort>
<httpsPort>443</httpsPort>
Once you have saved the changes, you will need to restart the rhttpproxy service by running the following command:
/etc/init.d/rhttpproxy restart
- For ESXi 8.0 - Please see Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 for updated instructions
- For ESXi 8.0 Update 1 and later - Please see Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 Update 1 for updated instructions
Jason Fenech says
Hi Will,
I tried this on a nested ESXi 6 host and once the https port is changed running any esxcli command results in a connection failure.
Here's the updated section in config.xml
/etc/vmware/rhttpproxy/endpoints.conf
80
4443
And here's the console's output;
[root@localhost:/etc/vmware/rhttpproxy] /etc/init.d/rhttpproxy restart
watchdog-rhttpproxy: Terminating watchdog process with PID 36328
VMware HTTP reverse proxy stopped.
VMware HTTP reverse proxy started.
[root@localhost:/etc/vmware/rhttpproxy] esxcli
Connect to localhost failed: Connection failure.
Changing it back to 443 reestablishes normal functionality.
Any ideas why it won't work?
Incidentally I tried it on ESX 5.0 and it works fine even though you need to allow the updated port through the firewall by adding a rule to /etc/vmware/firewall/service.xml. (http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1021199)
Also, if I may, would you happen to know if the same procedure can be carried out on ESXi 5.1 and 5.5? I'm carrying out some testing on behalf of clients and I failed to find any reference or other posts which provide an answer.
Thanks
Jason
Jason Fenech says
{proxy}
{!-- default location of the proxy config file --}
{endpoints}/etc/vmware/rhttpproxy/endpoints.conf{/endpoints}
{!-- HTTP port to be used by the reverse proxy --}
{httpPort}80{/httpPort}
{!-- HTTPS port to be used by the reverse proxy --}
{httpsPort}4443{/httpsPort}
{/proxy}
reposting config.xml bit using curly brackets instead ...
blacksharkmedia says
For ESXi it doesn't work, the esxicli network will show nothing, the rhttpproxy restarts just fine but the ESXi will become unavailable to connect even on local lan
Marcos Eduardo Ricchetti says
Man. Tks a LOT !!
Andrew says
So are we saying that if you change the https port you can no longer connect to the host on LAN? I've chnaged the https port in the: /etc/vmware-rhttpproxy/config.xm file to 4443 and in the VpxClient.exe.config file on my laptop to 4443 and I am unable to connect to the host via the vShpere client...this is all pointless...all I want to do is connect to it from the office and home and 443 is busy for me on my external firewall....any ideas anyone?? Many thanks Andrew
Martin Yates says
Hi Andrew - I cant help, but I am seeking the steps to do the same thing on 5.5 ESx ! I have a VM host at home and I have got the following to work :
WIndows vSphere client on 443 -> hits my router - router has port forwarding 443 set to -> VMWare host ip.
Now, I want to use 443 for Exchange, to setup active synch etc, so i want to change the ports for accessing my VMhost.
Yes I got as far as finding the config file at /etc/vmware/config.xml
I access my server with Putty -
I can add lines to this file to change the ports, but I cant save it - it says the file is read only. I found a KB saying I need to copy the file, edit it, and then save it back ! This can apparently be done with "vifs" in the console.
But I cant find "vifs" - is it part of the console commands in 5.5?
Martin Yates says
just to rectify my typo in the abovethe above, the config file is held at
/etc/vmware/hostd.config.xml
Satendra says
thanks for posting, it's very helpful & success. after changes prot VC is working fine.
Satendra says
C:\ProgramData\VMware\vCenterServer\cfg\vmware-rhttpproxy\config.xml
go through this path & changes.
Bruce says
Hi,
If I changed http 80 to others. esxcli will not work and shows IO error.
If any available method to solve this problem.
Agnes says
Even I am seeing the same behavior