diff --git a/proxy/httpd.conf b/proxy/httpd.conf index 8108b64..6268a68 100644 --- a/proxy/httpd.conf +++ b/proxy/httpd.conf @@ -560,12 +560,18 @@ ProxyPreserveHost on # Pass the base domain from the environment PassEnv "APACHE_PROXY_BASE_DOMAIN" -# Pass the sophon backend image name from the environment +# Pass the sophon backend and frontend image name from the environment PassEnv "SOPHON_BACKEND_NAME" +PassEnv "SOPHON_FRONTEND_NAME" -# Proxy regular requests to the backend -# sophon.steffo.eu → backend +# Proxy regular requests to the frontend +# sophon.steffo.eu → frontend RewriteCond "%{HTTP_HOST}" "^${ENV:APACHE_PROXY_BASE_DOMAIN}$" [NC] +RewriteRule "/(.*)" "http://${ENV:SOPHON_FRONTEND}/$1" [P,L] + +# Proxy api requests to the backend +# api.sophon.steffo.eu → backend +RewriteCond "%{HTTP_HOST}" "^api.${ENV:APACHE_PROXY_BASE_DOMAIN}$" [NC] RewriteRule "/(.*)" "http://${ENV:SOPHON_BACKEND_NAME}/$1" [P,L] # Create a map between the proxy file generated by Sophon and Apache