|
|
@ -19,6 +19,7 @@ my $auth = $domain->prop('Authentication') || 'none'; |
|
|
|
my @groups = split(/[;,]/, ($domain->prop('AllowGroups') || '')); |
|
|
|
my @groups = split(/[;,]/, ($domain->prop('AllowGroups') || '')); |
|
|
|
my $ssl_port = $modSSL{'TCPPort'} || '443'; |
|
|
|
my $ssl_port = $modSSL{'TCPPort'} || '443'; |
|
|
|
my $proto = ($port eq $ssl_port ) ? 'https' : 'http'; |
|
|
|
my $proto = ($port eq $ssl_port ) ? 'https' : 'http'; |
|
|
|
|
|
|
|
my $socketio = $domain->prop('ProxySocketIO') || 'disabled'; |
|
|
|
|
|
|
|
|
|
|
|
# ProxyPass ? |
|
|
|
# ProxyPass ? |
|
|
|
if ($target =~ m|https?://[\d\w\.\-/]*|){ |
|
|
|
if ($target =~ m|https?://[\d\w\.\-/]*|){ |
|
|
@ -31,6 +32,26 @@ if ($target =~ m|https?://[\d\w\.\-/]*|){ |
|
|
|
if ($proxy_acme eq 'disabled'){ |
|
|
|
if ($proxy_acme eq 'disabled'){ |
|
|
|
$OUT .= " ProxyPass /.well-known/acme-challenge/ !\n"; |
|
|
|
$OUT .= " ProxyPass /.well-known/acme-challenge/ !\n"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if ($socketio eq 'enabled'){ |
|
|
|
|
|
|
|
# Try to handle Socket.IO |
|
|
|
|
|
|
|
my $wstarget = $target; |
|
|
|
|
|
|
|
$wstarget =~ s/^http:/ws:/; |
|
|
|
|
|
|
|
$wstarget =~ s/^https:/wss:/; |
|
|
|
|
|
|
|
$OUT .=<<"_EOF" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<IfModule mod_proxy_wstunnel.c> |
|
|
|
|
|
|
|
RewriteCond %{QUERY_STRING} transport=polling [NC] |
|
|
|
|
|
|
|
RewriteRule /socket.io/(.*) ${target}socket.io/\$1 [P,L] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ProxyPass /socket.io/socket.io.js ${target}socket.io/socket.io.js |
|
|
|
|
|
|
|
ProxyPassReverse /socket.io/socket.io.js ${target}socket.io/socket.io.js |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ProxyPass /socket.io/ ${wstarget}socket.io/ |
|
|
|
|
|
|
|
ProxyPassReverse /socket.io/ ${wstarget}socket.io/ |
|
|
|
|
|
|
|
</IfModule> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_EOF |
|
|
|
|
|
|
|
} |
|
|
|
$OUT .= " ProxyPass / $target\n"; |
|
|
|
$OUT .= " ProxyPass / $target\n"; |
|
|
|
$OUT .= " ProxyPassReverse / $target\n"; |
|
|
|
$OUT .= " ProxyPassReverse / $target\n"; |
|
|
|
} |
|
|
|
} |
|
|
|