Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SSL-Proxy with mod_rewrite - correcting the BaseURL
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
chiborg  
View profile  
 More options Oct 29 2012, 5:24 pm
From: chiborg <gabriel.bi...@gmail.com>
Date: Mon, 29 Oct 2012 14:24:40 -0700 (PDT)
Local: Mon, Oct 29 2012 5:24 pm
Subject: SSL-Proxy with mod_rewrite - correcting the BaseURL

I have a rewrite rule that converts requests to
https://ssl.example.com/name/foo as a proxy request to
http://name.example.com/foo

it looks like this:

RewriteMap      domaindb        txt:/etc/apache2/ssldomains
RewriteRule     ^/www\.([^/]+)/(.*)     /${domaindb:$1|%{HTTP_HOST}/$1}/$2
     [S=2]
RewriteRule     ^/([^/]+)/(.*)          /${domaindb:$1|%{HTTP_HOST}/$1}/$2
     [S=1]
RewriteRule     ^/(.+)                  /$1/                    [R,L]
RewriteRule     ^/(.*)                  http://$1               [P,L]

The RewriteMap maps "name" to "name.example.com"

I see that HTTP_X_FORWARDED_FOR, HTTP_X_FORWARDED_HOST
and HTTP_X_FORWARDED_SERVER are set.
Unfortunately the base url stays the same, so all generated urls are wrong.
What's the best way to avoid this?

My best idea at the moment is to write an event handler
for onEarlyKernelRequest, execute it after the
original onEarlyKernelRequest handler from RouterListener.
Another way would be to write my own Request class and use it instead of
the original class. I'm not sure if that's the right way.

Or maybe there is another server configuration that allows for BOTH
subdomains (without SSL) and subfolders (with SSL, all on the same
subdomain)?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcelh19242  
View profile  
 More options Nov 3 2012, 1:55 pm
From: marcelh19242 <heers.mar...@googlemail.com>
Date: Sat, 3 Nov 2012 10:55:42 -0700 (PDT)
Local: Sat, Nov 3 2012 1:55 pm
Subject: Re: SSL-Proxy with mod_rewrite - correcting the BaseURL

Hi,

I'm having exactly the same problem atm.
I'm currently trying to solve it with this bundle:
https://github.com/frosas/BaseUrlBundle
but it does not work yet.

I think, that these two pull-requests for Symfony2.2 are also dealing with:
https://github.com/symfony/symfony/pull/3958
https://github.com/symfony/symfony/pull/3865

I tryed the current 2.2-dev but it made no change . . .


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
marcelh19242  
View profile  
 More options Nov 16 2012, 3:04 pm
From: marcelh19242 <heers.mar...@googlemail.com>
Date: Fri, 16 Nov 2012 12:04:38 -0800 (PST)
Local: Fri, Nov 16 2012 3:04 pm
Subject: Re: SSL-Proxy with mod_rewrite - correcting the BaseURL

Actually I got it working now.

I used this bundle:
https://github.com/clicktrend/ReverseProxyBundle

The only thing, if you are also using FOSUserBundle, you have to change
some lines in your security.yml like this:

        main:
            pattern: ^/
            form_login:
                provider: custom
                login_path:  https://ssl.example.com/<https://ssl.example.com/name/foo>
foo/login
                always_use_default_target_path: true
                default_target_path:  https://ssl.example.com/<https://ssl.example.com/name/foo>
foo/
            logout:
                target: https://ssl.example.com/<https://ssl.example.com/name/foo>
foo/
            anonymous:    true

Now it should work!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »