How to change port 4443 for web connections
This article applies to v8 or higher. Since version 8, the NoMachine web server, nxhtd, accepts only encrypted connections on port 4443 (HTTPS).
Administrators may change the listen port via server's UI:
1) Click on the !M icon in the system tray to open the menu.
2) Click on Show the service status and finally on Ports.
3) in the Ports panel, select HTTPS and click on 'Configure' to access the panel for changing ports. Authenticating with a privileged account is requested.
4) Restart the nxhtd service to make changes effective. This will drop current sessions via web if any.
As an alternative, administrators can configure nxhtd manually.
Edit manually the nxhtd configuration file, web.cfg:
/usr//NX/etc/web.cfg on Linux
/Applications/NoMachine.app/Contents/Frameworks/etc/web.cfg on macOS
C:\Program files (x86)\NoMachine\etc\web.cfg on Windows
Let's assume that you want to change the default port from 4443 to 443 on Linux or macOS. In short, it's necessary to change the default value for the HTTPS port, 4443, to the new value everywhere. In detail:
STEP 1 - Shutdown nxhtd
sudo /etc/NX/nxserver --stop nxhtd
STEP 2 - Edit web.cfg
2.1. replace:
Listen 0.0.0.0:4443 https
with:
Listen 0.0.0.0:443 https
2.2. and:
<VirtualHost 0.0.0.0:4443>
with:
<VirtualHost 0.0.0.0:443>
2.3. and:
RewriteEngine On
ReWriteCond %{SERVER_PORT} !^4443$
RewriteCond %{REQUEST_URI} !^/?favicon.ico$
RewriteRule ^/(.*) https://%{SERVER_ADDR}:4443/nxwebplayer [R,L]
with:
RewriteEngine On
ReWriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !^/?favicon.ico$
RewriteRule ^/(.*) https://%{SERVER_ADDR}:443/nxwebplayer [R,L]
STEP 3 - start nxhtd
sudo /etc/NX/nxserver --start nxhtd
On Windows, perform the same steps as above. Execute commands from a CMD console run as administrator, move to the NoMachine 'bin' directory:
cd C:\Program files (x86)\NoMachine\bin\
and execute the server commands from there, e.g.
nxserver --stop nxhtd
