Skip to content

Commit

Permalink
enh: added redirect response location rewrite example for haproxy
Browse files Browse the repository at this point in the history
  • Loading branch information
lprimak committed Sep 17, 2024
1 parent 94772a3 commit a41a068
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/site/content/jakarta-ee.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
----

Expand Down

0 comments on commit a41a068

Please sign in to comment.