You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by lp...@apache.org on 2024/09/17 02:59:09 UTC

(shiro-site) branch main updated: enh: added redirect response location rewrite example for haproxy

This is an automated email from the ASF dual-hosted git repository.

lprimak pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shiro-site.git


The following commit(s) were added to refs/heads/main by this push:
     new a41a0683a enh: added redirect response location rewrite example for haproxy
a41a0683a is described below

commit a41a0683ab6fe99890154e700f012f213cf317b6
Author: lprimak <le...@flowlogix.com>
AuthorDate: Mon Sep 16 21:58:43 2024 -0500

    enh: added redirect response location rewrite example for haproxy
---
 src/site/content/jakarta-ee.adoc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/site/content/jakarta-ee.adoc b/src/site/content/jakarta-ee.adoc
index 3f8dc27f8..2d9fb29ce 100644
--- a/src/site/content/jakarta-ee.adoc
+++ b/src/site/content/jakarta-ee.adoc
@@ -211,12 +211,15 @@ ssl.alwaysEnabled = true
 ==== Using Enhanced SSL filter with HAProxy or other load balancers
 When behind SSL-terminating proxy, Shiro may not be able to determine if SSL was used.
 `X-Forwarded-Proto` header can mitigate this. You can configure your proxy set this header to `https` to tell Shiro
-when SSL is used. Below is a haproxy configuration excerpt:
+when SSL is used. In addition, it's always good practice to rewrite redirect response headers.
+Below is a haproxy configuration excerpt:
 [source]
 ----
 ....
 frontend tcp-in
     http-request set-header X-Forwarded-Proto https if { ssl_fc }
+backend server1
+    http-response replace-header Location ^http://(.*)$ https://\1
 ...
 ----