Apache Apach使用自定义端口(如3128)将https 443重定向到https
我在同一台机器上的Squid代理服务器前面使用Apache web服务器,并从Letsencrypt获得SSL证书,Apache服务器现在是受信任的绿色站点。 我更改了htaccess文件,以满足在两种情况下使用https或不使用https访问Apache的Squid服务器的需要。因此,我的htaccess文件如下所示:Apache Apach使用自定义端口(如3128)将https 443重定向到https,apache,.htaccess,redirect,https,port,Apache,.htaccess,Redirect,Https,Port,我在同一台机器上的Squid代理服务器前面使用Apache web服务器,并从Letsencrypt获得SSL证书,Apache服务器现在是受信任的绿色站点。 我更改了htaccess文件,以满足在两种情况下使用https或不使用https访问Apache的Squid服务器的需要。因此,我的htaccess文件如下所示: RewriteEngine On # if not https Redirect all requests to Squid except for Let's Encrypt
RewriteEngine On
# if not https Redirect all requests to Squid except for Let's Encrypt's ACME Challenge verification
RewriteCond %{HTTPS} off [NC]
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/ [NC]
RewriteRule ^(.*) http://backend.squid.server:3128/$1 [R=301,L]
# if https on Redirect all requests to Squid except for Let's Encrypt's ACME Challenge verification
RewriteCond %{HTTPS} on [NC]
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/ [NC]
RewriteRule ^(.*) https://backend.squid.server:3128/$1 [R=301,L]
第一部分是重定向良好,没有问题,我得到了squid服务器的响应。
但是当我们发送相同的请求,但使用https时,我得到了以下错误
连接后端.squid.server:3128时出错。
SSL收到的记录超过了允许的最大长度。
错误代码:SSL\u错误\u接收\u记录\u过长
我在Squid.conf上的内容,如果有帮助的话:
https_port 3128 cert=/etc/letsencrypt/live/mysite.tld/fullchain.pem key=/etc/letsencrypt/live/mysite.tld/privkey.pem
http_port 3128 act-as-origin name=server accel vhost
我认为使用自定义端口从HTTPS443重定向到https的问题。
如果有人处理过这样的问题,请告诉我问题出在哪里?htaccess文件中的正确语法是什么