source: mod_gnutls/test/tests/26_redirect_HTTP_to_HTTPS/apache.conf @ 7c0ccaf

debian/masterdebian/stretch-backportsjessie-backportsupstream
Last change on this file since 7c0ccaf was 7c0ccaf, checked in by Thomas Klute <thomas2.klute@…>, 4 years ago

Rename test "26_HTTPS_server_var" to "redirect_HTTP_to_HTTPS"

The new name makes more sense: The test case tests the redirection,
and while %{HTTPS} looks like a server variable, mod_rewrite actually
treats it as a special case.

  • Property mode set to 100644
File size: 1.0 KB
Line 
1# Turn environment variable TEST_HTTP_PORT into a server variable.
2Define  TEST_HTTP_PORT  ${TEST_HTTP_PORT}
3
4Include ${srcdir}/base_apache.conf
5GnuTLSCache dbm cache/gnutls_cache
6
7# mod_status offers an easy way to check if we were actually
8# redirected to HTTPS
9LoadModule      status_module   ${AP_LIBEXECDIR}/mod_status.so
10<Location /status>
11        SetHandler server-status
12</Location>
13
14# Configure mod_rewrite to redirect all HTTP request to HTTPS. Note
15# that "RewriteOptions Inherit" must be set inside virtual hosts,
16# otherwise they will ignore the global settings.
17LoadModule      rewrite_module  ${AP_LIBEXECDIR}/mod_rewrite.so
18RewriteEngine   On
19RewriteCond     "%{HTTPS}" "off"
20RewriteRule     "(.*)" "https://${TEST_HOST}:${TEST_PORT}%{REQUEST_URI}" [R=301,L]
21
22<VirtualHost _default_:${TEST_HTTP_PORT}>
23        ServerName      ${TEST_HOST}
24        RewriteOptions  Inherit
25</VirtualHost>
26
27<VirtualHost _default_:${TEST_PORT}>
28        ServerName              ${TEST_HOST}
29        RewriteOptions          Inherit
30        GnuTLSEnable            On
31        GnuTLSCertificateFile   server/x509.pem
32        GnuTLSKeyFile           server/secret.key
33        GnuTLSPriorities        NORMAL
34</VirtualHost>
Note: See TracBrowser for help on using the repository browser.