Apache 2의 클라이언트 인증에서 일부 경로/페이지를 제외하는 방법

Apache 2의 클라이언트 인증에서 일부 경로/페이지를 제외하는 방법

클라이언트 인증이 활성화된 Apache 서버를 설정하려고 합니다. 고객이 유효한 클라이언트 인증서를 사용하여 콘텐츠에 액세스할 수 있도록 합니다.

예를 들어, 서버가 다음과 같이 실행되고 있다고 가정해 보겠습니다.

https://myserver/myservice/

또한 일부 인증 정보를 제공하여 고객이 클라이언트 인증서를 얻을 수 있도록 인터페이스를 제공해야 합니다.

https://myserver/myservice/register

업로드 정보가 확인되면 클라이언트 인증서를 반환합니다.

내가 올바르게 이해했다면 이 경로는 단순히 인증서를 생성하는 데 사용되기 때문에 클라이언트 인증 메커니즘에서 제외되어야 합니다. 문제는 이를 달성하기 위해 어떻게 httpd 구성을 지정할 수 있느냐는 것입니다.

내 현재 구성은 다음과 같습니다.

ProxyPass /myservice/register http://localhost:4444/register

<Virtualhost *:443>
    ServerName myserver
    DocumentRoot /path/to/my/server/root
    ProxyPass /myservice/ ajp://localhost:8009/myservice/
    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCertificateFile /path/to/server.cert
    SSLCertificateKeyFile /path/to/server.key
    ...
    SSLVerifyClient require
    SSLVerifyDepth 10
    SSLCACertificateFile /path/to/ca.buddle.pem
</Virtualhost>

이 구성을 사용하면 다음에서 클라이언트 인증서를 얻을 수 있습니다.

http://myserver/myservice/register

그런 다음 이를 사용하여 서비스에 액세스합니다. 그런데 80 포트를 닫을 수 있도록 https로 설정하지 못했습니다.

답변1

이제 간단히 대상 URL 경로를 사용하거나 제외하는 방법으로 솔루션을 얻었습니다.

<Virtualhost *:443>
    ServerName myserver
    DocumentRoot /path/to/my/server/root
    ProxyPass /myservice/register http://localhost:4444/register
    ProxyPass /myservice/ ajp://localhost:8009/myservice/
    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCertificateFile /path/to/server.cert
    SSLCertificateKeyFile /path/to/server.key
    ...
    SSLVerifyClient require
    SSLVerifyDepth 10
    SSLCACertificateFile /path/to/ca.buddle.pem

    <LocationMatch ^/myservice/register$>
        SSLVerifyClient none
    </LocationMatch>

</Virtualhost>

관련 정보