LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-18-2012, 06:33 AM   #1
polishpt
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
Reverse proxy rewrite http problem


Hi,
first of all I want to say hi as I'm new here.

I need your help. I'm having problems with reverse proxy rewriting to https:

I have an alfresco app running on top of tomcat and as a front and an Apache server - it's site-enabled looks like that:

Code:
<VirtualHost *:80>
        ServerName alfresco

        JkMount /* ajp13_worker


        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature Off
</VirtualHost>
I also have a reverse proxy server running on second machine and i want it to rewrite queries to https. It's site-enabled looks like that:

Code:
<VirtualHost 192.168.251.50:80>
        ServerName alfresco

        DocumentRoot /var/www/


        RewriteEngine on
        RewriteRule (.*) https://alfresco/  [R]

        LogLevel warn
        ErrorLog  /var/log/apache2/alfresco-80-error.log
        CustomLog /var/log/apache2/alfresco-80-access.log combined
        ServerSignature Off
</VirtualHost>


<VirtualHost 192.168.251.50:443>
        ServerName alfresco

        DocumentRoot /var/www/

        SSLEngine On
        SSLProxyEngine On
        SSLCertificateFile      /etc/ssl/certs/alfresco.pem
        SSLCertificateKeyFile   /etc/ssl/private/alfresco.key

        SetEnvIf User-Agent ".*MSIE.*"  nokeepalive ssl-unclean-shutdown \
                                        downgrade-1.0 force-response-1.0

        ProxyRequests Off
        ProxyPreserveHost On

        <Proxy *>
                Order deny,allow
                Allow from all
        </Proxy>
 
        ProxyPass /alfresco       http://192.168.251.50:8080/alfresco
        ProxyPassReverse /alfresco http://192.168.251.50:8080/alfresco

        LogLevel warn
        ErrorLog /var/log/apache2/alfresco-443-error.log
        CustomLog /var/log/apache2/alfresco-443-access.log combined
        ServerSignature Off
</VirtualHost>
Now, ProxyPass works, when I go to alfresco/alfrsco in a browser application opens, but rewriting to https doesn't work.

Plese help.

Regards
 
Old 03-19-2012, 06:07 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,165
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi and welcome to LQ,
Quote:
Now, ProxyPass works, when I go to alfresco/alfrsco in a browser application opens, but rewriting to https doesn't work.
What do you mean by that? Does http://alfresco goes to https://alfresco? It should as your rewrite looks ok.
Maybe you want to use:
Code:
RewriteRule (.*) https://alfresco%{REQUEST_URI} [R]
so http://alfresco/alfresco rewrites to https://alfresco/alfresco

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse Proxy for non-web (non-http) ? cheezy Linux - Server 3 07-23-2014 09:54 PM
Apache reverse proxy & rewrite rule (maybe) hacksandmore Linux - Server 7 03-06-2012 08:41 PM
BigBlueButton, from http to https reverse proxy Steviepower Linux - Security 3 12-09-2010 07:58 AM
reverse proxy (HTTP) mapping not working properly noir911 Linux - Server 4 07-28-2009 07:25 AM
Squid reverse proxy problem (HTTPS to HTTP) RussP Linux - Networking 1 10-02-2008 01:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration