logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Header edit dynamic urls
Author
ThomasT



Joined: 05 Sep 2018
Posts: 8
Location: Germany

PostPosted: Tue 12 Mar '19 11:17    Post subject: Header edit dynamic urls Reply with quote

Hi,

i have this url:

https://myserver.com/foo?redirect=https://internal-dynamic:8433/bar

I want to rewrite this:

when I write

Header edit Location https://internal-dynamic:8433/ https://external/

then it works and the URL is rewritten.
It also work when I write:

Header edit Location https://internal-dynamic:8433/ https://%{CC_REWRITE_URL}e/

Then url is rewritten to content of variable CC_REWRITE_URL.
But when i try to use the varible in the expression, it will not work:

Header edit Location https://%{CC_REWRITE_URL}e/ https://external/

of course CC_REWRITE_URL has the value "internal-dynamic:8433" so it should be the same.

Can I not use dynamic expression in the Header edit Location expression?


Thomas
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Mon 18 Mar '19 14:25    Post subject: Reply with quote

Hi Thomas,
why not a a reverse proxy on port 443 to your internal server on port 8433?

Code:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so



<VirtualHost *:443>
    ServerName example.com
    DocumentRoot "c:/Apache24/htdocs"
    <Directory "c:/Apache24/htdocs">
        Options Indexes Includes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
    <Location />
        ProxyPass https://internal-dynamic:8433/
        ProxyPassReverse https://internal-dynamic:8433/
    </Location>
   SSLEngine on
   SSLCertificateFile conf/certs/fullchain.pem
   SSLCertificateKeyFile conf/certs/privkey.pem
</virtualhost>
Back to top
ThomasT



Joined: 05 Sep 2018
Posts: 8
Location: Germany

PostPosted: Mon 18 Mar '19 14:32    Post subject: Reply with quote

Because actually there more than one ulr.

https://externalurl/bla

https://externalurl/blubb

https://externalurl/foo
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Mon 18 Mar '19 14:38    Post subject: Reply with quote

Isn't okay to have that to

https://externalurl/bla --> https://internal-dynamic:8433/bla

https://externalurl/blubb --> https://internal-dynamic:8433/blubb

https://externalurl/foo --> https://internal-dynamic:8433/foo
Back to top


Reply to topic   Topic: Header edit dynamic urls View previous topic :: View next topic
Post new topic   Forum Index -> Apache