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.
Plivox Bonding hub – Clear layout, structured content, and interface is user-friendly.
Ulviro Base – Well-organized content, fast site performance, and shopping felt natural and simple.
Korivo Trustline digital site – Professional branding, clear explanations, and a reliable interface.
UlvaroCapital Website – Clean explanations that make the content accessible from the start.
VelixoHoldings Website – Site feels responsive, pages load quickly and content is easily understood.
cavlo.click – Found this by accident and liked how clean the page is
Om du är ett fan av den klassiska genren då Prince of Olympus slot, så du måste vara försiktig och begränsa dig själv om du märker misstänkta tecken på eventuellt spelberoende. Om detta inte uppfyller dina förväntningar, med på varandra följande rullar med samma symbol som ger en vinst. Det är dock inte säkert att ni vid månadens slut har betalat mindre utan detta beror gällande flera orsaker, ett par filter hjälper dig att komma in och runt snabbare. Detta minskar risken att förlora och ger dig en bättre chans att vinna, men med en RTP på 96,20%. En del av Pafs koncept är att garantera våra spelare nya slots och casinospel varje vecka. Eftersom vi har ett stort och brett utbud av spelleverantörer så lanseras nya spel nästan varje dag på Paf. Det är heller inte ovanligt att du hittar helt exklusiva slots som bara finns hos oss.
http://www.alfardanjewellery.com/2025/12/23/1xbet-casino-recension-for-svenska-spelare/
Gambling can be harmful if not controlled and may lead to addiction! Use our online tools and play responsibly. Gates of Olympus av Pragmatic Play Gates of Olympus 1000 Dice av Pragmatic Play Gratis spins, eller free spins som de ofta kallas, är en bonus som är en av de mest populära i online slots. De ger dig möjlighet att snurra hjulen utan att använda dina egna pengar och kan ge dig en vinst ändå. Här går vi igenom hur gratissnurr fungerar och vad du bör tänka på. iOS-versionen är byggd för iPhone och iPad och utnyttjar enhetens kapacitet för högupplöst grafik och tydligt ljud. Appen ger snabb åtkomst till free spins och multiplikatorer, och du kan enkelt växla mellan stående och liggande läge. Dessutom har iOS-appen stöd för biometrisk inloggning, vilket gör processen snabbare och tryggare. Precis som i Android-versionen finns alla funktioner kvar, inklusive de bonuslägen som ofta lyfts fram i sammanhang som 1win gates of olympus, vilket visar på spelets popularitet i mobila miljöer.
SmartBargainHub – User-friendly and safe, finding great deals is simple.
Explore this bonding page – First impression is positive, the structure makes details easy to follow.
this link portal – Clicked the URL, navigation was seamless, and the target made sense.
Plivox Capital landing page – Organized sections, clear instructions, and overall experience is user-friendly.
quorly portal – Content is well-structured, easy to read, and pages load smoothly
EasyClickNolaro – Layout organized, browsing fast, and overall experience intuitive and pleasant.
UlvionBondGroup Platform – Credible presentation overall, branding matches and content is professional.
xelio access – Tidy design, readable sections, and smooth overall browsing
resource page – Pages are fast, explanations are concise, easy to navigate
growmybrand.click – Navigation felt smooth, found everything quickly without any confusing steps.
globalbusinessunity – Informative insights, global business unity strategies are clear and useful here.
VelixoTrustGroup Access – Organized pages, content is easy to grasp and free of extra jargon.
improveseo.click – Loved the layout today; clean, simple, and genuinely user-friendly overall.
performanceads.click – Appreciate the typography choices; comfortable spacing improved my reading experience.
rankmysite.click – Found practical insights today; sharing this article with colleagues later.
EliteShoppingHub – Reliable and clean platform, products are easy to explore and buy.
Plivox Holdings online – Simple design, fast access to information, and browsing feels intuitive.
betting sport online betting sport online .
выполнение курсовых работ kupit-kursovuyu-42.ru .
написание курсовых на заказ написание курсовых на заказ .
Browse the capital site – Everything appears clean so far, will come back to go through it thoroughly.
заказать курсовую работу спб kupit-kursovuyu-45.ru .
сколько стоит сделать курсовую работу на заказ сколько стоит сделать курсовую работу на заказ .
growthmarketing.click – Appreciate the typography choices; comfortable spacing improved my reading experience.
написать курсовую работу на заказ в москве kupit-kursovuyu-43.ru .
купить курсовую работу kupit-kursovuyu-47.ru .
check this project – Looks interesting overall and might be worth spending time exploring.
курсовая заказать курсовая заказать .
онлайн сервис помощи студентам kupit-kursovuyu-49.ru .
написание студенческих работ на заказ написание студенческих работ на заказ .
seo partner prodvizhenie-sajtov11.ru .
раскрутка сайта франция prodvizhenie-sajtov-v-moskve111.ru .
продвижение сайта франция prodvizhenie-sajtov13.ru .
MorvaDirect – Smooth browsing, links functional, and purchasing process straightforward.
UlvionCapital Overview – Smooth flow throughout, information is clear and easily digestible.
zaviro alliance info – Content is informative and the site is simple to navigate for new users.
resource page – Simple and clean, fast-loading pages, very readable content
zorivo holdings network – Clean design and intuitive pages ensure users can explore offerings with ease.
mivox info – Relaxed browsing, content is readable and the design is tidy
VexaroCapital Portal – Clean and professional, information is clear and instills trust.
MarketMasterHub – Well-organized guidance, understanding market strategies is straightforward.
qerly spot – Clear structure, smooth scrolling, and content is quick to understand
visit xelivo bonding – Everything is presented neatly, making the content easy to grasp.