<VirtualHost *:80>为什么总拦截处理 https 的请求?

讨论 未结 2 49
nowheretoseek
nowheretoseek 会员 2022年4月17日 08:21 发表
<p>如下一份配置,本来是将 http 重定向 https 的,之前用在 club 域名上,一切正常,现在换成 com 域名,结果总导致过多重定向错误。(另一份处理 443 端口的没帖上来。)</p> <p>确定是这个配置的问题,是因为将 RewriteEngine on 改成 off 后,问题就解决了。可是这个虚拟主机是处理 80 端口的问题的啊。为什么访问 <a href="https://www.example.com" rel="nofollow">https://www.example.com</a> 的时候,他总要插手呢?</p> <pre><code class="language-httpd">&lt;VirtualHost *:80&gt; ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/html/example &lt;Directory /var/www/html/example/&gt; Options -Indexes +FollowSymLinks Include /etc/apache2/custom.d/globalblacklist.conf DirectoryIndex index.php AllowOverride All Require all denied &lt;/Directory&gt; ErrorLog ${APACHE_LOG_DIR}/example_error.log CustomLog ${APACHE_LOG_DIR}/example_access.log combined RewriteEngine on RewriteCond %{SERVER_NAME} =example.com RewriteRule ^ https://www.%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] RewriteCond %{SERVER_NAME} =www.example.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] &lt;/VirtualHost&gt; </code></pre>
收藏(0)  分享
相关标签: 灌水交流
注意:本文归作者所有,未经作者允许,不得转载
2个回复
  • nowheretoseek
    2022年4月17日 09:10
    问题已解决,是 cloudflare 的问题,开启了 Development Mode 可是还是用了缓存。 将 dns 中的 a 记录从 proxied 改成 dns only ,或者开着 Development Mode 时清除 cache 问题消失了,不知何故。 是我对 Development Mode 理解有误,还是怎么了? Development Mode 的备注解释是: Temporarily bypass our cache. See changes to your origin server in realtime.
    0 0
  • Showfom
    2022年4月17日 09:10
    CF 的话,你打开 SSL/TLS 设置,改成 Full 或者 Full (strict) 然后 Edge Certificates 里 Always Use HTTPS 打开
    0 0