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.
sweet bonanza пряме завантаження apk http://www.sweet-bonanza91683.help
мелбет odengi вывод https://melbet64019.help/
sweet bonanza bono para usuarios actuales http://sweet-bonanza60829.help
mobiel csgo wedden codes – Norris -
1win promo code for deposits http://www.1win60751.help
naar nieuwe site snooker wedden (Glenn) sport
sweet bonanza apk android México sweet bonanza apk android México
sweet bonanza cómo retirar a tarjeta sweet bonanza cómo retirar a tarjeta
beste bookmaker e-promo wedden hockey 2026
Хороший разбор SEO-услуг от ITB Company. Автор подробно останавливается на важности технической оптимизации, пользовательского опыта и локального SEO для Екатеринбурга. Отдельно понравился блок про контент-стратегию — почему полезные статьи работают лучше простого перечисления ключей. Вот ссылка: https://sah-zx.ru/stati/kak-seo-prodvizhenie-s-itb-company-pomogaet-biznesu-ekaterinburga-rasti/
1вин лайв https://1win06741.help
Добрый день Что делает сайт эффективным Лендинг помогает пользователю быстро понять предложение компании. Создание лендингов строится на ясной структуре страницы. Разработка лендинга повышает конверсию и помогает сайту под ключ приносить заявки. Полная информация по ссылке – https://ts-v.ru/ SEO продвижение сайтов для образовательных курсов реклама строительных компаний под ключ интернет-магазин на Битрикс под ключ ведение рекламных кампаний в Google Ads ђазработка лендингов под ключ TS-V управление рекламными кампаниями Google Ads Удачи и комфорта в жизни Что делает лендинг эффективным 6966bd1
Сайт упёрся в 4–5 место по важным запросам, дальше не двигается. В статье нашёл сценарий «Запросы уперлись в ТОП-10». Автор объясняет, что разница между 1-м и 5-м местом — в разы по трафику, и точечная накрутка помогает сделать рывок на 2–3 позиции выше. Приводит примеры и объясняет механику. Решил протестировать. Ссылка: https://yagla.ru/blog/drugoe-o-marketinge/nakrutka-povedencheskih-faktorov-v-2026–2604u119831/
I’d like to find out more? I’d like to find out more details.
Jogo do Tigrinho ao vivo: quem já ganhou assistindo dealer?
Howdy exceptional website Does running a blog similar to this require a lot of work? I have very little expertise in coding however I had been hoping to start my own blog soon. Anyhow should you have any suggestions or techniques for new blog owners please share. I understand this is off topic nevertheless I just needed to ask. Thanks https://teletype.in/avtobloggerua/D36QcnKeQ2k
sweet bonanza teléfono soporte http://www.sweet-bonanza60829.help
Jogo do Tigrinho ao vivo: quem já ganhou assistindo dealer?
1win link расмӣ http://1win06741.help/
1win install apk without errors https://www.1win60751.help
К слову, если вас интересует vavada вывод денег, загляните сюда. Вот, можете почитать: https://vavadaigry.com/deposit/
Особенно понравился пост про я сказал vavada. Вот, делюсь ссылкой: https://vavadasloty.com
real online casino for android
top online casino europe
real money casino ipad app
1win хуруҷ ба корти бонкӣ https://www.1win06741.help
1win personal cabinet http://1win60751.help
мелбет ошибка регистрации https://melbet64019.help
melbet изменить почту http://melbet64019.help
Hey everyone!
Looking for a reliable gaming platform in Canada?
I recommend Spinmills — a crypto-friendly gaming site: spinmills.ca
Crypto accepted. Highly recommended.
What do you think?
1win depozit Azərbaycan dili http://www.1win27096.help
мостбет официальный сайт Бишкек http://mostbet09547.help
Думаю, кому-то может быть полезно: https://f1-it.ru/uslugi-smm-prodvizheniya-v-sotsialynh-setyah.html
cómo funciona sweet bonanza casino sweet-bonanza60829.help
sweet bonanza скачать android sweet-bonanza91683.help
Wonderful post but I was wanting to know if you could write a litte more
on this topic? I’d be very grateful if you could elaborate a little bit more.
Thanks!
Особенно понравился материал про регистрация и бонусы в казино вавада для казахстана. Ссылка ниже: https://2026vavada.com/
1win çıxarış https://1win27096.help/
sweet bonanza retirar con visa México sweet bonanza retirar con visa México
I’ve been browsing online more than three hours today, yet I never found any interesting article like yours.
It is pretty worth enough for me. Personally, if all web owners and bloggers made good content as
you did, the internet will be much more useful than ever before.
mostbet бонус Кыргызстан mostbet бонус Кыргызстан
1win çıxarış https://www.1win27096.help
http://perfectbuilding.ru/user/aliciagreen/
1win aviator mərc http://www.1win27096.help
http://perfectbuilding.ru/user/aliciagreen/
мостбет бонус Кыргызстан http://mostbet09547.help/
mostbet создать аккаунт mostbet создать аккаунт
sweet bonanza поповнення без верифікації http://sweet-bonanza91683.help/
Fortune Rabbit no Pix: quem depositou e saiu com giros grátis?
sweet bonanza обхід блокування sweet bonanza обхід блокування
sweet bonanza зміна пароля https://sweet-bonanza91683.help/
mostbet bonusové zneužití https://mostbet2018.help