【发布时间】:2015-12-05 01:45:49
【问题描述】:
我在 docker 容器 debian:jessie 上运行 apache 2.4 时遇到代理重定向问题。
我的服务器配置如下:
<Directory "{{SERVER_ROOT}}">
Options Indexes FollowSymLinks
# New directive needed in Apache 2.4.3:
Require all granted
</Directory>
还有一个 .htaccess 规则:
# Redirect crawlers to prerender (crawl)
RewriteCond %{HTTP_USER_AGENT} !^Prerender
RewriteCond %{HTTP_USER_AGENT} (Google|facebookexternalhit/1.1|Facebot|facebookexternalhit|Googlebot|bingbot|Googlebot-Mobile) [NC]
RewriteCond %{QUERY_STRING} _escaped_fragment_|prerender=1
RewriteRule ^ http://prerender:3000/https://demo.mysite.com%{REQUEST_URI} [P,L]
调用预渲染服务器时:
curl -k -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://demo.mysite.com/\?_escaped_fragment_\=/scan-f
我在 apache-ssl-error.log 中收到以下错误:
[Fri Dec 04 16:21:38.346574 2015] [core:error] [pid 14] (2)No such file or directory: [client 10.0.9.156:39937] AH00132: file permissions deny server access: proxy:http://prerender:3000/https://demo.mysite.com/index.php?_escaped_fragment_=/scan-f
我已经检查并且所有相关文件都有用户和组 apache。 可以从 debian 访问 Prerender 服务器,并且可以直接调用代理 url。此外,所有站点都可以从浏览器访问,但不能用于重定向。
知道我做错了什么吗?
谢谢!
【问题讨论】:
-
不,我没有 SELinux