Configuring NoMachine server v10 to use the proxy for connections to license server and NoMachine Network
NoMachine server v10 can be configured to connect to the License Server through a proxy when this is requested by the environmental settings and Company's policies. By default the NoMachine server ignores the https_proxy environment variable and doesn't use a proxy, which is the most common case.
Connections through a proxy can be enabled as explained below.
If the NoMachine server will be published on NoMachine Network, it will use the proxy also for connecting to the Network server. Such connection is established when the server host is added to NoMachine Network. Proxy settings will be used also for every outgoing connections from that server host through NoMachine Network.
For the connection to the License Server, new proxy settings will be applied immediately.
For connections to NoMachine Network, we need to distinguish between two cases:
a) if the connection to NoMachine Network is not established, the new proxy settings are applied to the new connection is established.
b) if the connection to NoMachine Network is already established and after the new proxy settings is still running, it will continue to use the old route and old settings.
In this case, you can force using the new settings tby running the 'nxserver --proxyupdate' command.
Run the 'nxserver --proxyupdate' command to make changes effective, you will be requested for confirmation. This will disconnect all active connections through NoMachine Network:
On Linux and macOS:
$ sudo /etc/NX/nxserver --proxyupdate
on Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --proxyupdate
To apply proxy settings silently and without asking for confirmation, add the --nopromt option to command above:
On Linux and macOS:
$ sudo /etc/NX/nxserver --proxyupdate --nopromt
on Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --proxyupdate --nopromt
There are two ways to configure NoMachine proxy settings:
i) The server will try to retrieve automatically proxy settings from the system and use them.
On Linux proxy settings are specified in the /etc/environment file, on Windows and MacOS they are set in System Settings.
ii) or the administrator can provide the necessary settings manually.
i) Configure NoMachine server to retrieve proxy settings automatically
On the NoMachine server host, execute the following command.
On Linux and macOS:
$ sudo /etc/NX/nxserver --proxyadd --type system
on Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --proxyadd --type system
ii) Configure proxy settings manually
On the NoMachine server host, execute the following command.
On Linux and macOS:
$ sudo /etc/NX/nxserver --proxyadd --type manual --host HOST
on Windows:
> %ALLUSERSPROFILE%\NoMachine\nxserver\nxserver.exe --proxyadd --type manual --host HOST
Optionally specify username and password of the proxy, if it requires that, by adding the --username and --password parameters to command above:
nxserver --proxyadd --type manual --host HOST --port PORT --username USERNAME --password
Note that the password cannot be passed as parameter, it will be requesting via prompt while executing the command.
Default protocol is HTTP, if the proxy uses SOCKS, specify it by adding '--protocol SOCKS' to the command above:
nxserver --proxyadd --type manual --host HOST --port PORT --protocol SOCKS
Also in this case, run the 'nxserver --proxyupdate' command to make changes effective, you will be requested for confirmation. To run the command silently and without request for confirmation, add the --nopromt option to the command.
Additional commands to manage proxy settings
1) nxserver --proxyinfo
Retrieve information about current proxy settings
2) nxserver --proxyedit OPTION
Edit any of the parameters that can be specified by 'nxserver --proxyadd'.
3) nxserver --proxydel
Disable using the proxy for connecting to the License Server and to NoMachine Network servers.
To delete username and password of the proxy user, add the --username parameter:
nxserver --proxydel --username
To set an empty password for the username, if already set,:
nxserver --proxydel --password
