0

我正在尝试使用 apache 和 phusion 乘客在我的本地主机上配置 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

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

谢谢。

4

1 回答 1

0

我不得不把

  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

在 default-ssl :P 愚蠢的错误

于 2010-08-31T05:33:36.877 回答