diff options
Diffstat (limited to '')
-rwxr-xr-x | sca-cpp/trunk/modules/http/httpd-conf | 4 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/http/httpd-ssl-conf | 32 |
2 files changed, 29 insertions, 7 deletions
diff --git a/sca-cpp/trunk/modules/http/httpd-conf b/sca-cpp/trunk/modules/http/httpd-conf index 61996928b3..8a6928d823 100755 --- a/sca-cpp/trunk/modules/http/httpd-conf +++ b/sca-cpp/trunk/modules/http/httpd-conf @@ -143,6 +143,10 @@ Listen $listen <VirtualHost $vhost> ServerName http://$host:$pport +RewriteEngine on +RewriteCond %{HTTP_HOST} !^$host [NC] +RewriteRule .* http://$host:$pport%{REQUEST_URI} [R,L] + Include conf/svhost.conf </VirtualHost> diff --git a/sca-cpp/trunk/modules/http/httpd-ssl-conf b/sca-cpp/trunk/modules/http/httpd-ssl-conf index aff1767522..e48902fd82 100755 --- a/sca-cpp/trunk/modules/http/httpd-ssl-conf +++ b/sca-cpp/trunk/modules/http/httpd-ssl-conf @@ -44,13 +44,6 @@ org=`openssl x509 -noout -subject -nameopt multiline -in $root/cert/ca.crt | gre # Generate HTTPD configuration cat >>$root/conf/httpd.conf <<EOF # Generated by: httpd-ssl-conf $* -# Redirect all HTTP traffic to HTTPS -<Location /> -RewriteEngine on -RewriteCond %{SERVER_PORT} ^$port$ [OR] -RewriteCond %{SERVER_PORT} ^$pport$ -RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L] -</Location> # Configure SSL support AddType application/x-x509-ca-cert .crt @@ -86,6 +79,31 @@ ExtendedStatus On EOF +# Generate HTTP vhost configuration +cat >>$root/conf/svhost.conf <<EOF +# Generated by: httpd-ssl-conf $* +# Redirect HTTP traffic to HTTPS +<Location /> +RewriteEngine on +RewriteCond %{SERVER_PORT} ^$port$ [OR] +RewriteCond %{SERVER_PORT} ^$pport$ +RewriteRule .* https://$host:$sslpport%{REQUEST_URI} [R,L] +</Location> + +EOF + +cat >>$root/conf/dvhost.conf <<EOF +# Generated by: httpd-ssl-conf $* +# Redirect HTTP traffic to HTTPS +<Location /> +RewriteEngine on +RewriteCond %{SERVER_PORT} ^$port$ [OR] +RewriteCond %{SERVER_PORT} ^$pport$ +RewriteRule .* https://%{SERVER_NAME}:$sslpport%{REQUEST_URI} [R,L] +</Location> + +EOF + # Generate HTTPS vhost configuration cat >$root/conf/vhost-ssl.conf <<EOF # Generated by: httpd-ssl-conf $* |