![Apache 和 Thin,错误的协议](https://linux22.com/image/551108/Apache%20%E5%92%8C%20Thin%EF%BC%8C%E9%94%99%E8%AF%AF%E7%9A%84%E5%8D%8F%E8%AE%AE.png)
您好,我有以下 apache 配置,它应该将端口 433 上的所有流量驱动到使用名为 Thin 的小型服务器的某个平衡器。
<VirtualHost *:443>
ServerAdmin webmaster@localhost
SSLEngine On
SSLCertificateFile /etc/ssl/private/localhost.pem
DocumentRoot /home/me/projects/contest/public/
<Proxy balancer://thinservers>
BalancerMember http://127.0.0.1:3000
</Proxy>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
RewriteEngine On
# Redirect all non-static requests to thin
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://thinservers%{REQUEST_URI} [P,QSA,L]
ProxyPass / balancer://thinservers/
ProxyPassReverse / balancer://thinservers/
ProxyPreserveHost on
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
无论如何,我在 Thin 服务器中获取的 URL 从 https 更改为 http,但我希望 Thin 服务器将它们视为 https。不确定哪里出了问题以及该怎么办。有什么建议吗?
答案1
这是一个猜测,但我认为您可能需要
SSLProxyEngine ON
在块之前使用这个:
从这里: http://httpd.apache.org/docs/2.0/mod/mod_ssl.html#sslproxyengine