gpt4 book ai didi

ruby-on-rails - 在本地主机中使用 apache 和 passenger 的 ssl

转载 作者:太空宇宙 更新时间:2023-11-03 15:07:23 25 4
gpt4 key购买 nike

我正在尝试使用 apache 和 phusion passenger 在我的本地主机上配置 SSL。我正在使用虚拟主机。

我在 sites-available/myapp 中有以下配置


VirtualHost *:80
ServerName myapp
DocumentRoot /home/madhu/ror/myapp/public
RailsEnv development
Directory /home/madhu/ror/myapp/public
AllowOverride all
Options -MultiViews
Order allow,deny
allow from all
Directory
VirtualHost


VirtualHost *:443
ServerName myapp
DocumentRoot /home/madhu/ror/myapp/public
ProxyPass / http://myapp/
ProxyPassReverse / http://myapp/
ProxyPreserveHost On
RequestHeader set X_FORWARDED_PROTO 'https'
Directory /home/madhu/ror/myapp/public
AllowOverride all
Options -MultiViews
Order allow,deny
allow from all
Directory
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem
SSLProxyMachineCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem
VirtualHost

SSL 已启用,一切正常。但是当我转到 url https://myapp/login 时,它说“在此服务器上找不到请求的 URL/login”。当我查看 apache 日志时,我发现请求将转到/var/www/login 而不是/home/madhu/ror/myapp/public。这是错误日志


[client 127.0.0.1] File does not exist: /var/www/login

有什么我想念的吗?请帮忙

谢谢。

最佳答案

我不得不把

  ServerName myapp
DocumentRoot /home/madhu/ror/myapp/public
RequestHeader set X_FORWARDED_PROTO 'https'
Directory /home/madhu/ror/myapp/public
AllowOverride all
Options -MultiViews
Order allow,deny
allow from all
Directory
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem
SSLProxyMachineCertificateFile /etc/ssl/certs/Thawte_Server_CA.pem

在默认 ssl 中:P 愚蠢的错误

关于ruby-on-rails - 在本地主机中使用 apache 和 passenger 的 ssl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3535511/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com