Apache reverse proxy to docker, nodejs or any other service

It's possible to use reverse proxy on DirectAdmin quite easily, however it's important to not block for example Let's Encrypt.

We will use port 8086 as an example here, navigate as admin user to:

Server Manager >> Custom HTTPD Configurations >> "Select applicable domain" httpd.conf >> Customize >> Put the following code under CUSTOM2

RewriteEngine On
RewriteCond %{REQUEST_URI} !^\.well-known/(.*)
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
ProxyPreserveHost On
ProxyPass /.well-known !
ProxyPass "/" "http://localhost:8086/"
ProxyPassReverse "/" "http://localhost:8086/"

 

Example screenshot

DirectAdmin Apache reverse proxy


Was this article helpful?

mood_bad Dislike 0
mood Like 1
visibility Views: 1505