From e15803b4b12df2b6e625673409bc854b1d1dd751 Mon Sep 17 00:00:00 2001 From: noelmcloughlin Date: Mon, 5 Oct 2020 16:55:46 +0100 Subject: [PATCH] docs(example): document redirect 80->443 fix #226 --- docs/README.rst | 17 ++++++++++++++++- pillar.example | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/README.rst b/docs/README.rst index 1042d11..87bb1f0 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -14,7 +14,7 @@ apache :scale: 100% :target: https://github.com/semantic-release/semantic-release -Formulas to set up and configure the Apache HTTP server. +Formulas to set up and configure the Apache HTTP server on GNU/Linux, FreeBSD, and Windows OS. .. contents:: **Table of Contents** @@ -286,6 +286,21 @@ Example Pillar: path: 'salt://path/to/sites-available/conf/file' state: 'enabled' + sites: + # Force SSL: Redirect from 80 to 443 + example.com: + port: 80 + template_file: salt://apache/vhosts/redirect.tmpl + RedirectSource: 'permanent /' + # Trailing slash is important + RedirectTarget: 'https://example.com/' + example.com_ssl: + port: 443 + ServerName: example.com + SSLCertificateFile: /path/to/ssl.crt + SSLCertificateKeyFile: /path/to/ssl.key + SSLCertificateChainFile: /path/to/ssl.ca.crt + Testing ------- diff --git a/pillar.example b/pillar.example index c265866..28a2f51 100644 --- a/pillar.example +++ b/pillar.example @@ -165,8 +165,22 @@ apache: # Additional config as a # multi-line string here + # Force SSL: Redirect from 80 to 443 + example2.com: + port: 80 + template_file: salt://apache/vhosts/redirect.tmpl + RedirectSource: 'permanent /' + # Trailing slash is important + RedirectTarget: 'https://example.com/' + example2.com_ssl: + port: 443 + ServerName: example.com + SSLCertificateFile: /path/to/ssl.crt + SSLCertificateKeyFile: /path/to/ssl.key + SSLCertificateChainFile: /path/to/ssl.ca.crt + + # Use RedirectMatch Directive redirectmatch.com: - # Use RedirectMatch Directive # - https://httpd.apache.org/docs/2.4/fr/mod/mod_alias.html#redirectmatch # Require module mod_alias enabled: true