Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have one physical server that runs:

  • an Apache (httpd) server
  • another web server (let's say Tomcat for sake of argument) on port 1234

Can I configure the Apache server to act as a proxy for SSL traffic, while keeping the application server blissfully unaware of SSL?

What I imagine is:

What's the best setup to achieve this? (On Ubuntu, if that matters)

share|improve this question
If you have the option of replacing apache, take a look at nginx which is a lot easier to configure for this – hafichuk Nov 15 '11 at 16:24
@hafichuk - is Apache really that hard to configure for this use case? – ripper234 Nov 15 '11 at 16:51

If Tomcat runs on the standart ports (8080 - HTTP, 8009 - AJP) add this to yours Apache configuration:

<VirtualHost _default_:443>
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyVia On

    <Proxy *>
        Order deny,allow
        Allow from all

    <Location /app>
        ProxyPass        ajp://localhost:8009/app
        ProxyPassReverse ajp://localhost:8009/app

    #<Location /app>
    #    ProxyPass        http://localhost:8080/app
    #    ProxyPassReverse http://localhost:8080/app

    <Location "/app/WEB-INF/">
        deny from all

<VirtualHost *:80>
    RewriteEngine On
    RewriteRule ^/app$  https://%{HTTP_HOST}%{REQUEST_URI} [R]
share|improve this answer

Have a look at mod_proxy for Apache, and how to use it in 'reverse proxy' mode.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.