I need help accessing my docker container via my subdomain

Hi,

actually, reverse proxy is actually the way. First of all, you need to create your website wich you use to access your container.

Second step, you create your container and keep in mind your forward port.

After that, edit your /usr/local/lsws/conf/httpd_config.conf file, and add the following code in the end of file:

extprocessor ARANDOMNAME {
  type                    proxy
  address                 http://yourcyberpanelip:yourportforwared // http://123.123.345:3334
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

Save your file and go back to your website and edit the .htaccess file, with the follwing code:

RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
REWRITERULE ^(.*)$ http://THERANDOMNAMEINPREVIOUSFILE/$1 [P]

After that, do not forget to restart your Litespeed service.

For reference, check my tutorial about installing N8N on cyberpanel, wich is almost the same path.

1 Like