3

I have an issue with proxy configuration. I have the following .htaccess:

Options -Indexes +FollowSymLinks -MultiViews
# BEGIN Expire headers
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 5 seconds"
    ExpiresByType image/x-icon "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 648000 seconds"
    ExpiresByType application/javascript "access plus 648000 seconds"
    ExpiresByType application/x-javascript "access plus 648000 seconds"
    ExpiresByType text/html "access plus 6000 seconds"
    ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>
# END Expire headers

RewriteEngine On
RewriteBase /
RewriteRule ^api/(.*)$ https://12.123.123.12/api/$1 [L,P]

However, with this live I get the following error in my logs:

[Thu Nov 24 11:36:33.013304 2016] [ssl:error] [pid 31379] [remote mydomain.com:443] AH01961: SSL Proxy requested for shared.domain:80 but not enabled [Hint: SSLProxyEngine]
[Thu Nov 24 11:36:33.013325 2016] [proxy:error] [pid 31379] AH00961: HTTPS: failed to enable ssl support for mydomain.com:443 (mydomain.com)

I've tried adding the following line to the file:

SSLProxyEngine on

But this resulted in the following error:

/.htaccess: SSLProxyEngine not allowed her

Any idea whats going on?

UPDATE

It works fine if I set connection to http instead of https:

RewriteRule ^api/(.*)$ http://12.123.123.12/api/$1 [L,P]

However, I need to use https (certificate on 12.123.123.12 is self signed).

1

The documentation of SSLProxyEngine says that you can put it only inside the main server config or in a VirtualHost.

Now, not sure if you can just enable SSLProxyEngine in your main server config or your VirtualHost configuration and then rewrite / proxy to upstream in HTTPS from your .htaccess, you can give it a try and in case update the question here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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