配置代理的问题

配置代理的问题

我遇到了代理配置问题。我有以下问题.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]

但是,在这次直播中,我的日志中出现以下错误:

[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)

我尝试在文件中添加以下行:

SSLProxyEngine on

但这导致了以下错误:

/.htaccess: SSLProxyEngine not allowed her

知道发生什么事了吗?

更新

如果我将连接设置为 http 而不是 https,它就可以正常工作:

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

但是,我需要使用 https(12.123.123.12 上的证书是自签名的)。

答案1

的文件SSLProxyEngine说你只能将其放在主服务器配置或 VirtualHost 中。

现在,不确定您是否可以SSLProxyEngine在主服务器配置或 VirtualHost 配置中启用,然后从 .htaccess 重写/代理到 HTTPS 中的上游,您可以尝试一下,并在必要时在此处更新问题。

相关内容