I’m writing this down because it too me an age to figure out a way of doing this. I have a website which Tomcat is happily serving. Areas of the site require a secure connection so I’m using Spring security to require particular URLs to be accessed over HTTPS. It means that when I access http://example.org:8080/webapp/login, it’ll bump me to https://example.org:8443/webapp/login. Note: Tomcat is setup with the SSL connector and a self signed .keystore see (http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html).
I have two vhosts setup in Apache, one for the http://example.org and one for https://example.org. They are both using mod_proxy to ProxyPass and ProxyPassReverse requests to the appropriate Tomcat URL’s. The problem comes when switching to HTTPS from HTTP and vice versa. Ideally I wanted some sort of ProxyPassReverse declaration in my config for http://example.org what would change HTTP headers (that Spring sets) for https://example.org:8443/webapp into https://example.org. Except ProxyPassReverse doesn’t work like that.
Now, I realise I could simply not use Spring to manage which parts of the site should be accessed over HTTPS and which should not…and just setup Apache to redirect as appropriate. I don’t want to do that though, because that makes the task of adding these restrictions a deploy time task, rather than a development time task. I don’t want to risk someone forgetting to add new restrictions when deploying the webapp and I’d much rather the developer added these restrictions when they were working on the task and really thinking about where and when they are needed.
So, how do I solve the problem so that the app can manage its secure-ness and I can setup Apache once and forget about it? The answer is to ProxyPassReverse onto a “special” URL, which when accessed will redirect to the HTTPS (or HTTP) site. For example, if the HTTP site needed to redirect to the HTTPS site, I’d add rules like so to perform the redirect:
# Proxy a request (from the server) to switch to https onto a special URL "/2https/"
ProxyPassReverse /2https/ https://example.org:8443/webapp/
# When a client requests a URL prefixed with "/2https" map it onto the secure site
RewriteRule ^/2https/(.*)$ https://example.org/$1 [R,L]
…and you’d add something similar to the secure site Apache config. As long as I don’t mount any pages at /2http or /2https I should be ok. Note a couple of things:
- You’ll need “SSLProxyEngine on” and “RewriteEngine on” and obviously the appropriate Apache modules loaded for these commands.
- Because of the redirect between HTTP <-> HTTPS you won’t be able to POST data between them directly (I’m not sure why you’d NEED to though)
- Obviously you’ll need to setup Apache with an SSL certificate…but that is a different story
I should say a special thanks to this random site – from whence the idea actually came from. If anyone has any better ideas on how to do it I’d love to hear them. Please comment below.
мелбет мбанк melbet36290.help
Wichtiger Versicherungs-Check Viele sind falsch oder unnotig teuer versichert. Prufen Sie jetzt in 2 Minuten Ihren Stature: – Haben Sie Versorgungslucken? – Zahlen Sie zu viel? – Ist Ihr Schutz aktuell? Jetzt kostenlos prufen: https://www.mara-ammersee.de/versicherungcheck
sportwetten tipps kostenlos
Review my web page Basketball Wetten Bei Betolimp
секс на тренировке по йоге секс на тренировке по йоге .
1xbetgiri? 1xbet-47.com .
sportwetten online bonus ohne einzahlung
Also visit my blog :: sichere Wetten für heute
Fortune Tiger cartinha x10: melhor sensação do ano ou só sorte pura? Vote!
Fortune Rabbit wilds expansivos: já cobriu a tela inteira? Mostra o print!
плинко crash плинко crash
реконструкция зданий и объектов remont-zdaniya-1.ru .
усиление грунта под домом усиление грунта под домом .
плинко жүктеу ios https://www.plinko61038.help
plinko коэффициенты http://plinko61038.help
ставки на спорт melbet киргизия http://melbet36290.help/
мостбет баромад аз ҳисоб https://www.mostbet95163.help
йога секс йога секс .
mostbet Исфара http://mostbet95163.help/
wett tipps morgen
Review my website :: wettanbieter ohne wettsteuer – assetguards.com,
Прочитал статью и задумался о безопасности. Мало кто пишет, как обнаружить накрутку поведенческих факторов на своём сайте. А здесь целый блок с признаками: аномальная активность, несезонный трафик, странная геолокация, резкий рост CTR без оптимизации. Очень полезный чек-лист для тех, кто подозревает нечестную игру конкурентов. Сохранил себе ссылку. Рекомендую изучить раздел “Как обнаружить накрутку”, чтобы вовремя заметить угрозу.
мелбет бонус на депозит melbet36290.help
инъекционное закрепление грунтов инъекционное закрепление грунтов .
wettrechner kombiwette
My website Wetten com bonus ohne einzahlung, gratis-wetten.com,
1xbwt giri? 1xbet-52.com .
Thousands of slots live dealers and epic odds — Betano has it all. https://tikitakagm.org/it/how-to-play/ Sign up spin big smile wider — that’s the Betano promise.
чӣ тавр кешбеки мелбет-ро гирифтан чӣ тавр кешбеки мелбет-ро гирифтан
wettstrategien test
Also visit my website sportwetten öSterreich Anbieter
sweet bonanza ua https://sweet-bonanza54072.help
xbet giri? 1xbet-47.com .
мелбет plinko https://melbet41682.help/
1xbet t?rkiye giri? 1xbet t?rkiye giri? .
Fortune Tiger cartinha x10: melhor momento do ano ou só sorte?
PAOK 1-2 Celta Vigo 2026 Europa League thriller result
1win aviator cote http://1win5808.help
mostbet бонус дар Тоҷикистон mostbet бонус дар Тоҷикистон
Всем привет! Рзучал тему развития бизнеса РІ интернете Рё наткнулся РЅР° полезную статью. Там РїСЂРѕ комплексное продвижение сайтов: SEO, контекст, контент-маркетинг, соцсети, аналитику. Есть блок РїСЂРѕ ошибки Рё РїСЂРѕ современные тренды — персонализация, РР, омниканальность. Рекомендую Рє прочтению: https://wikicom.ru/2025/12/jeffektivnoe-prodvizhenie-sajtov-i-razvitie-biznesa-v-internete/
Всем привет! Нашел статью, где хорошо расписаны основы продвижения сайтов. Рассматриваются цели, стратегия, SEO, контекстная реклама, SMM, email-маркетинг, UX/UI. Особо отмечу раздел про интеграцию онлайн и офлайн активностей — редко встречается в таких обзорах. Вот ссылка для изучения: https://dogvoyage.ru/2025/12/jeffektivnoe-prodvizhenie-sajtov-i-razvitie-biznesa-v-internete/
one x bet 1xbet-52.com .
мостбет слотҳо app mostbet95163.help
online pokies reviews australia, free online united kingdom roulette simulator and best Blackjack games for pc pokies united kingdom,
or casino uk paypal
мелбет букмекер воридшавӣ мелбет букмекер воридшавӣ
Fortune Ox explosão total: já limpou a tela 4 vezes numa sessão?
plinko скачать apk и установить http://plinko61038.help/
1xbet giri? adresi 1xbet-47.com .
sweet bonanza дозволи додатка https://sweet-bonanza54072.help/
1win english site https://1win5523.ru/
ставки crash melbet https://melbet41682.help/
sweet bonanza локалізація українською sweet-bonanza54072.help
1win deposit methods https://www.1win5523.ru
sweet bonanza створити профіль http://sweet-bonanza54072.help
wettbüro krefeld
my blog: sportwetten experten tipps [Lawrence]