Apache Proxy Pass On Main Domain

SupianIDz

New member
Joined
Dec 4, 2019
Messages
2
Location
Indonesia
I have 3 domains and several sub domains in one user, for example:

  • foo.com
    • a.foo.com
    • b.foo.com
  • bar.com
    • a.bar.com
  • baz.com

Then I want to use Apache Proxy Pass on the domain foo.com

by making configuration in
/usr/local/directadmin/data/templates/custom/virtual_host2.conf

|*if DOMAIN="foo.com"|
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:2368/
ProxyPassReverse / http://localhost:2368/

RequestHeader set X-Forwarded-Proto "https"
|*endif|


However, all domains and sub domains point to the proxy, how to make only foo.com point to the proxy?

Thank you.
 
because you are modifying general server template.
add your modifications directly for one domain from admin level at "Custom Httpd"
like https://help.directadmin.com/item.php?id=199
Yes, now I understand.

My problem was solved by adding this syntax on "Custom Httpd"

|*if DOMAIN="foo.com"|
|*if !SUB|
RequestHeader set X-Forwarded-Proto "https"

ProxyPreserveHost On
ProxyPass / http://localhost:2368/
ProxyPassReverse / http://localhost:2368/
|*endif|
|*endif|

thanks for the reply.
 
Back
Top