openlitespeed icon indicating copy to clipboard operation
openlitespeed copied to clipboard

Multilevel Subdomain Wildcard Matching

Open dresch86 opened this issue 5 years ago • 1 comments

I have a complex subdomain setup that is necessary to support a legacy application, and it involves the use of multilevel subdomains (i.e. https://mycommunity.registration.mynotforprofit.com). For my VHost mapping I mapped the virtual host to the "*.registration.mynotforprofit.com" wildcard however OLS does not recognize it properly and it falls through to domain "*.mynotforprofit.com".

Matching on a single level subdomain (i.e. *.mydomain.com) works as is expected, and I had the same setup running on Apache.

If I manually enter the "mycommunity.registration.mynotforprofit.com" into the domain map it works just fine, and the VHost loads as expected. Is multilevel subdomain wildcard support not included or is this a regex bug?

dresch86 avatar Oct 01 '20 04:10 dresch86

For anyone who has this problem, I solved it by manually editing the listener config map statement order in conf/httpd_config.conf. If you add the more specific wildcards (i.e. the multilevel subdomains) toward the top, they will hit first and work as expected. The documentation should reflect this.

dresch86 avatar Oct 10 '20 01:10 dresch86