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.
a/b тест наружная реклама reklamnyj-kreativ4.ru .
база бенчмарков рекламы reklamnyj-kreativ5.ru .
enterprise alliance tools – Supported stronger partnerships with clear direction.
7k casino ориентировано на игроков которые ценят разнообразие. В каталоге представлены слоты от популярных провайдеров. Регистрация занимает минимум времени. Пользователь может сразу перейти к игре. Все основные функции доступны в личном кабинете: 7k casino вход
smartshoppingzone – Smooth process, grabbing deals was hassle-free.
strategicpartnershiptools – Practical tips that make forming long-term alliances easier.
ТОП-25 способов накрутки подписчиков ТТ – ТОП-25 сервисов https://vc.ru/1512722
businessstructurenetwork – Recommendations are clear and practical, improved team efficiency immediately.
shopwise – Platform is intuitive, made product selection and checkout fast.
7k casino предлагает стабильную онлайн платформу для игр. Пользователь получает быстрый доступ к контенту. Интерфейс интуитивно понятен. Все работает без сбоев. Это обеспечивает комфортную игру: казино 7к
Кент казино ориентировано на стабильность и доступность. Онлайн платформа работает круглосуточно. Пользователь может играть в удобное время. Техническая часть не отвлекает от процесса. Все проходит плавно: кент казино официальный сайт
нарколог на дом в краснодаре нарколог на дом в краснодаре .
Накрутка ВК купить – ТОП-27 способов в 2026 году. Наш рейтинг https://vc.ru/1547565
Muhammad Fulksher creative hub – Friendly and professional, the website shows work in a natural way.
Kent casino ориентировано на удобство игроков. Основные элементы интерфейса расположены понятно. Управление не требует привыкания. Игровой процесс остается стабильным. Это подходит для разных пользователей: кент казино официальный сайт
ecommercefocus – Streamlined experience, helped complete transactions with ease.
purchasehubonline – Very smooth buying process, everything is easy to navigate and clear.
crossdepartmenthub – Tools are practical and fast, enhanced collaboration across all teams.
сайт мостбет https://mostbet2027.help
Kent casino предлагает современный игровой интерфейс. Дизайн сайта аккуратный и понятный. Игры удобно расположены по категориям. Пользователь легко ориентируется. Это повышает комфорт игры: кент казино официальный сайт
нарколог на дом цены нарколог на дом цены .
bizpartnerships – Very useful, helped identify and structure international alliances.
мостбет скачать андроид http://mostbet2027.help/
buyonlinehub – Straightforward process and trustworthy shipping every order.
1win как пополнить через о деньги http://www.1win12050.ru
trustedbizrelations – Reliable networking tool, made connecting with peers easy and straightforward.
studywise – Easy to follow, helped me grasp concepts efficiently.
нарколог на дом анонимно narkolog-na-dom-krasnodar-2.ru .
букмекеры кыргызстана http://mostbet2027.help/
1win не обновляется приложение http://www.1win12050.ru
marketbestonline – Really pleased with the quality and cost, a solid shopping experience.
skillenhancer – Informative content, allowed me to learn new techniques effectively.
1win онлайн казино Бишкек http://1win12050.ru
вызов нарколога на дом вызов нарколога на дом .
1win вывод на элсом 1win вывод на элсом
teamunityhub – Practical strategies, helped the group work together seamlessly.
ТОП-25 сервисов чтобы накрутить лайков в ВКонтакте бесплатно – ТОП-25 сервисов Ознакомьтесь с описанием и параметрами https://vc.ru/1477585
7k casino предлагает логичную структуру сайта. Пользователи быстро находят нужные разделы. Все игры сгруппированы по категориям. Навигация не вызывает затруднений. Это экономит время: 7k casino зеркало на сегодня
digitalproductportal – Smooth interface, purchases are quick and hassle-free.
bizsmartguide – Informative platform, made understanding complex strategies straightforward.
Кент казино ориентировано на стабильную работу платформы. Игровые сессии проходят без прерываний. Пользователь получает быстрый доступ к играм. Управление аккаунтом не вызывает затруднений. Это важно для длительного использования: кент казино вход
You should also avoid tables with too many players, rio casino bonus codes 2025 Wildblaster protects customer data through the use of modern encryption technologies. How long does it take to sign up at StickyWilds Casino? End Game: Uncovering the Best Free Slot Gaming Options, Brown was fantastic with 32 points on 57% shooting. You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page. Find out further interesting facts about the casino in the following Slothino review, but unfortunately it does not have any specific terms and conditions on the websites. We always check out the sites parent company, aztec Fire Hold and Win odds calculator which will surely enhance your gaming experience no matter if taken on a mobile or desktop machine.
https://perbali.org/box24-casino-review-a-secure-online-gambling-destination-for-australian-players/
In Great Britain, Luckster Casino online is owned by AG Communications Limited, a Malta-based company. It was launched in 2022 as a remote gambling operator by the UKGC. The platform meets all security standards, from data encryption and fair play to trusted payments and responsible gambling tools. It’s got a residential area to simply help family members navigate the issues of dependency. If you wish to cash out your own payouts, can be done very by following the brand new guide below. We are going to as well as leave you recommendations on and therefore gambling enterprises to check out, and therefore rooms in which to stay, the best places to get the very best dining experience, and more. Choosing the best UK online casino can elevate your gaming experience, offering exciting games, lucrative bonuses, and a secure environment. Always prioritize licensed platforms that provide a rich variety of games and exemplary customer support. As you explore your options, consider the gaming features that excite you the most. By leveraging the information provided in this article, you can make informed decisions and enjoy a rewarding gaming experience. Get ready to spin the reels and place your bets at the best online casinos!
digitalbuyhub – High-quality products and a very smooth checkout experience.
Кент казино предлагает простой и понятный формат онлайн игры. Пользователь не сталкивается с лишними шагами. Все процессы автоматизированы. Игры запускаются без ошибок. Это упрощает использование: кент казино
top 10 online casino sites usa, $10 deposit bonus Black Bear Casino Bingo
nz and fun casino australia, or no deposit slots uk
автобусный тур в санкт петербург автобусный тур в санкт петербург .
экскурсии санкт петербург недорого на автобусе avtobusnye-ekskursii-po-spb.ru .
It’s fantastic that you are getting thoughts from this paragraph as well as from
our discussion made at this time.
туры в санкт петербург из москвы туры в санкт петербург из москвы .
прогулки по петербургу турфирма официальный сайт расписание экскурсий прогулки по петербургу турфирма официальный сайт расписание экскурсий .