Apache http rewire重写https报错

2021-07-14 11:37:22 浏览数 (1)

场景:Apache 需要把当前网址的sapi这个路径用RewriteRule重写到一个第三方的https网址下

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^sapi "https://www./search/apache/1/" [P,L]

</IfModule>

默认开启了

LoadModule proxy_http_module modules/mod_proxy_http.so

LoadModule proxy_module modules/mod_proxy.so

报错:

AH01112: HTTPS: declining URL https://www./search/apache/1/ (mod_ssl not configured?)

AH01144: No protocol handler was valid for the URL /sapi (scheme 'https'). If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

开启

LoadModule ssl_module modules/mod_ssl.so

报错:AH01961: SSL Proxy requested for xxx.xxx.xxx.xxx:80 but not enabled

在站点中添加

SSLProxyEngine On

SSLProxyVerify none

SSLProxyCheckPeerCN off

SSLProxyCheckPeerName off

<VirtualHost *:8080>

ServerAdmin webmaster@dummy-host.example.com

DocumentRoot "/public_html/default/"

<Directory "/public_html/default/">

Options -Indexes FollowSymLinks

AllowOverride All

Require all granted

</Directory>

SSLProxyEngine On

SSLProxyVerify none

SSLProxyCheckPeerCN off

SSLProxyCheckPeerName off

ServerName demo.

LogLevel debug

ErrorLog "/public_html/default/error.log"

CustomLog "/public_html/default/access.log" common

</VirtualHost>

成功

0 人点赞