NethServer Version: 7.9.2009
Module: WebServer
I need some extra Lines in just one of my reverse proxies:
RewriteCond %{HTTP:Upgrade} =websocket [NC] RewriteRule /notifications/hub(.*) ws://<DESTINATION_IP>:3012/$1 [P,L] RequestHeader set X-Real-IP <NETHSERVER_IP>
For vhosts I had the same need and solved it via:
/etc/e-smith/templates-custom/httpd/vhost-extra/16matrix_redirect
{
$OUT = ‘’;
if( $ServerName eq ‘<MY.FQDN>’ && $Port == 443) {
$OUT .= <<REDIRECT;
# Here are
# The extra lines
# just for MY.FQDN on port 443
REDIRECT
} else {
$OUT = ‘’;
}
}
so I tried the same with
/etc/e-smith/templates-custom/httpd/proxy-extra/30ProxyPass
and in there a similar condition
(ANOTHER.FQDN is reverse proxy created via cockpit)
if( $ServerName eq ‘<ANOTHER.FQDN>’ && $Port == 443) { }
but this condition is never true.
Are there other variable names in proxy-extra then in vhost-extra ?
As a test I just wrote $ServerName and $Port to all my reverse proxies via that method.
The do not get substituted and are inserted to virtualhosts.conf as strings.
THX for a hint to the right direction / documentation
Tom