Apache, vhost, 리디렉션, https, SSL 문제

Apache, vhost, 리디렉션, https, SSL 문제

문제:

이 오류에 대한 재작성 로그에 항목이 없습니다.

가상 호스트 구성

<VirtualHost 127.0.1.3:80>
ServerAdmin [email protected]
ServerName www.example.com

DocumentRoot /var/www/html
<Directory /var/www/html>
    Options Indexes FollowSymLinks
    AllowOverride All


    Order allow,deny
    Allow from all
</Directory>


Redirect permanent /fundprocess.html https://example.com/fundprocess.html
Redirect permanent /fund_process.php https://example.com/fund_process.php

ErrorLog /var/log/apache2/example.com-error_log
TransferLog /var/log/apache2/example.com-access_log
LogLevel warn

RewriteLog /var/log/apache2/example.com-rewrite_log
RewriteLogLevel 9



</VirtualHost>


<VirtualHost 127.0.1.2:80>
ServerAdmin [email protected]
ServerName example.com
DocumentRoot /var/www/html

    RewriteCond %{REQUEST_URI} !fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} !fund_process.php [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    RewriteCond %{REQUEST_URI} fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} fund_process.php [NC]
    RewriteRule (.*) https://example.com/$1 [R=301,L]



</VirtualHost>



<VirtualHost 127.0.1.3:443>
ServerAdmin [email protected]
ServerName www.example.com
DocumentRoot /var/www/html

    RewriteCond %{REQUEST_URI} !fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} !fund_process.php [NC]
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]

    RewriteCond %{REQUEST_URI} fundprocess.html [NC]
    RewriteCond %{REQUEST_URI} fund_process.php [NC]
    RewriteRule (.*) https://example.com/$1 [R=301,L]


</VirtualHost>



<VirtualHost 127.0.1.2:443>
ServerAdmin [email protected]
ServerName example.com


DocumentRoot /var/www/html
<Directory /var/www/html>

    Options Indexes FollowSymLinks
    AllowOverride All


    Order allow,deny
    Allow from all

 </Directory>


RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !fundprocess.html [NC]
RewriteCond %{REQUEST_URI} !fund_process.php [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

ErrorLog /var/log/apache2/example.com-ssl-error_log
TransferLog /var/log/apache2/example.com-ssl-access_log
LogLevel warn

RewriteLog /var/log/apache2/example.com-rewrite_log
RewriteLogLevel 9


SSLEngine On
SSLCertificateFile /etc/certs/example.crt
SSLCertificateKeyFile /etc/certs/example.key


SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

</VirtualHost>

답변1

이는 리디렉션의 문제가 아니라 SSL의 문제입니다(리디렉션이 발생하기 전에 요청을 해독해야 함).

Listen 443Apache 구성에 어딘가가 있습니까 ? 그렇지 않은 경우 Listen 80 부분 근처에 붙이십시오. 이 서버에서 다른 SSL 웹사이트를 실행하고 있습니까? 동일한 IP 주소를 사용하고 있지 않은지 확인하세요. 마지막으로, 다른 곳에서 작동하는 SSL 인증서가 있다면 이 사이트에 사용해 보세요. 브라우저에 경고가 표시되지만 경고를 수락하면 리디렉션되어야 합니다. 그러면 문제가 SSL 인증서에 있다는 것을 알 수 있습니다.

답변2

ssl_error_rx_record_too_long은 Apache가 SSL을 기대하고 http를 수신할 때 발생합니다.

모든 포트 443 요청이 SSLEngine On. .<VirtualHost 127.0.1.3:443>

또한 인증서는 example.com과 *.example.com 모두에서 작동해야 합니다. 그렇지 않으면 클라이언트가 리디렉션 대신 보기 흉한 경고를 받게 됩니다.

관련 정보