apache - ScriptAlias ​​위치에 HTTP 기본 인증 필요

apache - ScriptAlias ​​위치에 HTTP 기본 인증 필요

나는 ScriptAlias다음과 같이 구성했습니다 :

<VirtualHost *:443>
    ScriptAlias /path/ "/path/to/bin/cgi"
</VirtualHost>

Apache를 사용하여 이 앞에 기본 인증 벽을 설치하고 싶습니다. 나의 첫 번째 본능은 시도하는 것입니다

<VirtualHost *:443>
    <Location "/path">
        ScriptAlias / "/path/to/bin/cgi"
        AuthType Basic
        AuthName ...
        ... other auth stuff ...
    </Location>
</VirtualHost>

그런데 이것을 시도하면 이런 오류가 발생합니다.

ScriptAlias cannot occur within directory context

이 앞에 기본 인증을 어떻게 넣나요? 감사합니다!

답변1

어떤 이유로 나는 이것을 시도하지 않았지만 효과가 있었습니다.

<VirtualHost *:443>
    ScriptAlias /path "/path/to/bin/cgi"
    <Location "/path">
        AuthType Basic
        AuthName ...
        ... other auth stuff ...
    </Location>
</VirtualHost>

관련 정보