From 3bfab934d124a00eb6cffe0641c74f54137605c8 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Wed, 9 Mar 2016 22:03:50 +0100 Subject: [PATCH] [ADD] example for apache --- letsencrypt/README.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/letsencrypt/README.rst b/letsencrypt/README.rst index 7d9e06134..9c9a186b2 100644 --- a/letsencrypt/README.rst +++ b/letsencrypt/README.rst @@ -71,7 +71,7 @@ You'll also need a matching sudo configuration, like:: your_odoo_user ALL = NOPASSWD: /usr/sbin/service nginx reload -Further, if you force users to https, you'll need something like:: +Further, if you force users to https, you'll need something like for nginx:: if ($scheme = "http") { set $redirect_https 1; @@ -83,6 +83,13 @@ Further, if you force users to https, you'll need something like:: rewrite ^ https://$server_name$request_uri? permanent; } +and this for apache:: + + RewriteEngine On + RewriteCond %{HTTPS} !=on + RewriteCond %{REQUEST_URI} "!^/.well-known/" + RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] + In case you need to redirect other nginx sites to your Odoo instance, declare an upstream for your odoo instance and do something like::