Browse Source

chg: [apache] custom rules are now before the content so as to add proxy rules if necessary

framadate
Valentin Lab 6 years ago
parent
commit
7f3e15f2af
  1. 9
      apache/lib/common
  2. 40
      apache/test/vhost

9
apache/lib/common

@ -342,6 +342,7 @@ SSLCertificateKeyFile $__vhost_cfg_SSL_KEY_LOCATION
$([ -z "$__vhost_cfg_SSL_CA_CERT_LOCATION" ] || echo "SSLCACertificateFile $__vhost_cfg_SSL_CA_CERT_LOCATION")
$([ -z "$__vhost_cfg_SSL_CHAIN" ] || echo "SSLCertificateChainFile $__vhost_cfg_SSL_CHAIN")
SSLVerifyClient None
EOF
}
@ -430,6 +431,7 @@ __vhost_proxy_statement() {
fi
cat <<EOF
##
## Proxy declaration towards $TARGET
##
@ -472,8 +474,8 @@ __vhost_full_vhost_statement() {
cat <<EOF
<VirtualHost *:$PORT>
$(__vhost_head_statement "$protocol" | prefix " ")
$(__vhost_head_statement "$protocol" | prefix " " && echo)
$(__vhost_custom_rules | prefix " " && echo)
$(__vhost_content_statement "$protocol" | prefix " ")
## Forbid any cache, this is only usefull on dev server.
@ -481,8 +483,7 @@ $(__vhost_content_statement "$protocol" | prefix " ")
#Header set Access-Control-Allow-Origin "*"
#Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
#Header set Access-Control-Allow-Headers "origin, content-type, accept"
$([ "$protocol" == "https" ] && __vhost_ssl_statement | prefix " ")
$(__vhost_custom_rules | prefix " ")
$([ "$protocol" == "https" ] && __vhost_ssl_statement | prefix " " && echo )
</VirtualHost>
EOF

40
apache/test/vhost

@ -63,7 +63,6 @@ is out '<VirtualHost *:80>
#Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
#Header set Access-Control-Allow-Headers "origin, content-type, accept"
</VirtualHost>' RTRIM
##
@ -239,6 +238,16 @@ is out '<VirtualHost *:80>
ErrorLog /var/log/apache2/www.example.com_error.log
ErrorLog syslog:local2
##
## Custom rules
##
RewriteEngine On
RewriteCond %{QUERY_STRING} !skin=formanoo
RewriteRule ^(/web/webclient/home.*)$ ?skin=formanoo [L,QSA,R=302]
##
## Proxy declaration towards popo:3333
##
@ -269,16 +278,6 @@ is out '<VirtualHost *:80>
#Header set Access-Control-Allow-Methods "POST, GET, OPTIONS"
#Header set Access-Control-Allow-Headers "origin, content-type, accept"
##
## Custom rules
##
RewriteEngine On
RewriteCond %{QUERY_STRING} !skin=formanoo
RewriteRule ^(/web/webclient/home.*)$ ?skin=formanoo [L,QSA,R=302]
</VirtualHost>
<IfModule mod_ssl.c>
@ -292,6 +291,16 @@ is out '<VirtualHost *:80>
ErrorLog /var/log/apache2/s-www.example.com_error.log
ErrorLog syslog:local2
##
## Custom rules
##
RewriteEngine On
RewriteCond %{QUERY_STRING} !skin=formanoo
RewriteRule ^(/web/webclient/home.*)$ ?skin=formanoo [L,QSA,R=302]
##
## Proxy declaration towards popo:3333
##
@ -334,14 +343,5 @@ is out '<VirtualHost *:80>
SSLVerifyClient None
##
## Custom rules
##
RewriteEngine On
RewriteCond %{QUERY_STRING} !skin=formanoo
RewriteRule ^(/web/webclient/home.*)$ ?skin=formanoo [L,QSA,R=302]
</VirtualHost>
</IfModule>' RTRIM
Loading…
Cancel
Save