2017-12-13 2 views
1

웹 사이트에서 유령 블로그 엔진을 실행하고 있습니다. 고스트 엔진 (localhost : 2368)에 프록시로 하위 도메인 blog.domain.com을 구성했지만 Google 검색 콘솔에서 해당 하위 도메인을 확인해야하므로 특정 문자열 (blog.domain.com/googlefile.html)을 반환해야합니다. domain.com/googlefile.html에서 같은 문자열을 사용할 수 있습니다.) 어떻게해야합니까? 내 가상 호스트 구성 :아파치 프록시가 모든 URL을 전달하고 하나의 특정 URL 만 다시 작성하십시오.

ServerName blog.example.com 
    ServerAlias *.blog.example.com 

    #here is what I tried 
    #RewriteEngine On 
    #RewriteCond %{HTTP_HOST} blog\.example\.com 
    #RewriteRule googlefile.html https://example.com/googlefile.html 

    ProxyPreserveHost On 
    ProxyPass/http://127.0.0.1:2368/ 
    ProxyPassReverse/http://127.0.0.1:2368/ 

Btw. 모든 도메인은 https입니다.

답변

1

이 솔루션은 URL을 무시 그래서 프록시 된 HTTPS URL은 또한 프록시 mod_rewrite를 사용할 수 있습니다

SSLProxyEngine On # enable SSLProxyEngine 
    ServerName blog.example.com 
    ServerAlias *.blog.example.com 

    RewriteEngine On 
    RewriteCond %{HTTP_HOST} blog\.example\.com 
    RewriteRule googlefile.html https://example.com/googlefile.html [P] 

    ProxyPreserveHost On 
    ProxyPass googlefile.html ! # ignore the rewrited url 
    ProxyPass/http://127.0.0.1:2368/ 
    ProxyPassReverse/http://127.0.0.1:2368/ 
을 SSLProxyEngine 수 있도록했다
관련 문제