Running Nginx + Apache on a Directadmin server, you can still configure Nginx to proxy requests to your Node.JS or Python application for your domain. And here is how can you do it.
All commands provided in the guide should be executed by "root" superuser in a server console (i.e. SSH).
Check the directory "/usr/local/directadmin/data/templates/custom/" whether it already contains the following files:
If it does not, then copy the mentioned files from "/usr/local/directadmin/data/templates/":
cd /usr/local/directadmin/data/templates/custom/ cp -p ../nginx_server.conf . cp -p ../nginx_server_secure.conf .
Then open them in a text editor one by one and update.
Add at the top of the file the following line:
|?PROXY_PASS=http://`PROXY_IP`:`PORT_8080`|
Save changes and exit.
Add at the top of the file the following line:
|?PROXY_PASS=https://`PROXY_IP`:`PORT_8081`|
Save changes and exit.
Now run:
perl -pi -e "s#proxy_pass http.*:\/\/\|PROXY_IP\|:\|PORT_808.*\|;#proxy_pass \|PROXY_PASS\|;#" nginx_server.conf nginx_server_secure.conf
By completed this step we get a new custom token which can be changed on per domain bases in DirectAdmin Web-UI.
Let's say we have an application on 127.0.0.1:2121 and want requests to example.net to be redirected to it. For it:
|?PROXY_PASS=http://127.0.0.1:2121/|
Save changes, wait a minute and have fun!