How to disable web connections by HTTPS and use only HTTP
This article refers to NoMachine software which supports browser-based connections from version 6.10 or later. If you are using 6.9 or earlier please consult https://www.nomachine.com/AR07P00986-
The NoMachine web server, nxhtd, which is a minimal Apache web server, is configured by default to redirect all HTTP requests to secure HTTPS.
Even if this is the advisable configuration in almost cases, administrators may wish to connect NoMachine web sessions only by HTTP. These are the steps to disable HTTPS in nxhtd.
Step 1 - Stop nxhtd.
For example on Linux, run from command line:
sudo /etc/NX/nxserver --stop nxhtd
Step 2 - Edit the /usr/NX/etc/htd.cfg file and looks for the following lines:
" Listen 0.0.0.0:4080 Listen 0.0.0.0:4443 https "
Comment HTTPS' port by pre-pending a #, to disable listening nxhtd on 4443 [HTTPS] port.
These lines, after commenting them, should look like:
" Listen 0.0.0.0:4080 #Listen 0.0.0.0:4443 https "
Also look for the following lines:
"
RewriteEngine On
ReWriteCond %{SERVER_PORT} !^4443$
RewriteCond %{REQUEST_URI} !^/?favicon.ico$
RewriteRule ^/(.*) https://%{SERVER_ADDR}:4443/nxwebplayer [R,L]
"
Comment them by pre-pending a #, to disable the redirect directive. And add whitelist of URL's for HTTP. These lines, after commenting them, should look like:
On Windows:
"
#RewriteEngine On
#ReWriteCond %{SERVER_PORT} !^4443$
#RewriteCond %{REQUEST_URI} !^/?favicon.ico$
#RewriteRule ^/(.*) https://%{SERVER_ADDR}:4443/nxwebplayer [R,L]
<VirtualHost _default_:*>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/?nxwebplayer$ [NC]
RewriteCond %{REQUEST_URI} !^/?(event|eventinit)$
RewriteCond %{REQUEST_URI} !^/?nxplayer/(js|images|style|languages)/.*$
RewriteCond %{REQUEST_URI} !^/?nxinfo/[a-fA-F0-9]{32}\.info$
RewriteCond %{REQUEST_URI} !^/?favicon.ico$
RewriteCond %{REQUEST_URI} !^/?$
RewriteRule ^(.*)$ - [F,L]
PassEnv ALLUSERSPROFILE USERPROFILE
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
"
On Unix:
"
#RewriteEngine On
#ReWriteCond %{SERVER_PORT} !^4443$
#RewriteCond %{REQUEST_URI} !^/?favicon.ico$
#RewriteRule ^/(.*) https://%{SERVER_ADDR}:4443/nxwebplayer [R,L]
<VirtualHost _default_:*>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/?nxwebplayer$ [NC]
RewriteCond %{REQUEST_URI} !^/?(event|eventinit)$
RewriteCond %{REQUEST_URI} !^/?nxplayer/(js|images|style|languages)/.*$
RewriteCond %{REQUEST_URI} !^/?nxinfo/[a-fA-F0-9]{32}\.info$
RewriteCond %{REQUEST_URI} !^/?favicon.ico$
RewriteCond %{REQUEST_URI} !^/?$
RewriteRule ^(.*)$ - [F,L]
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
</VirtualHost>
"
Step 3 - Start nxhtd
For example on Linux:
sudo /etc/NX/nxserver --start nxhtd
Note: In order to use HTTP, type in the browser, for example:
