Correct steps to access subdomains without port number?

Just want to make sure if this is the correct way to access say: Openlitespeed, Cyberpanel or a portainer server. At least it worked for CP & OLS where I can access it via cp.domain.com and
ols.domain.com respectively.

Let’s assume the subdomains for all three services are as follows:

  1. cp.domain.com
  2. ols.domain.com
  3. portainer.domain.com

I would edit the /usr/local/lsws/conf/httpd_config.conf file and add the following code. BTW the 127.0.0.01 worked for me, but e,g. cp.domain.com in the httpd_config.conf file did not.

extprocessor cyberpanel {
  type                    proxy
  address                 https://127.0.0.01:8443
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

extprocessor ols {
  type                    proxy
  address                 https://127.0.0.01:7080
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

extprocessor portainer {
  type                    proxy
  address                 https://127.0.0.01:9443
  maxConns                100
  pcKeepAliveTimeout      60
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

Then for each domain created via CP UI, I would add the following rewrite rule

REWRITERULE ^(.*)$ HTTP://cyberpanel/$1 [P]
REWRITERULE ^(.*)$ HTTP://ols/$1 [P]
REWRITERULE ^(.*)$ HTTP://portainer/$1 [P]

Small update:

What is strange is that if I used cp.domain.com:8443 & ols.domain.com:7080 in the httpd_config.conf file, CP & OLS are NOT accessible. However with 127.0.0.1:XXXX they are.

But with portinainer I have to use portainer.domain.com:9443 for it to work without the port number? 127.0.0.1:9443 will NOT work without port :man_shrugging:t3:

Anyone have an idea why that is? That makes no sense to me…Or are CP & OLS setup differently in terms of networking and such?