Apache2反向代理身份验证

时间:2020-06-09 15:41:34

标签: authentication proxy apache2 reverse-proxy

防火墙具有运行Apache2的主服务器开放的端口443和8443。反向代理配置为在端口8443上代理另一台内部服务器,并且此方法可以正常工作....但是我似乎无法使身份验证正常工作,该代理对外界的任何人都是开放的。是的,.htpasswd似乎正确,等等,似乎只是被忽略了。

这是配置:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    #   SSL Engine Switch:
    #   Enable/Disable SSL for this virtual host.
    SSLEngine on

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>

    <Directory /usr/lib/cgi-bin>
            SSLOptions +StdEnvVars
    </Directory>

</VirtualHost>

<VirtualHost _default_:8443> 
        <Proxy *>
            Order deny,allow
            #Allow from all
            Authtype Basic
            Authname "Password Required"
            AuthUserFile /etc/apache2/.htpasswd
            Require valid-user
        </Proxy>  

    SSLEngine on
    ProxyPreserveHost On
    ProxyRequests Off
    ServerName xxxxxxxxx.com
    ServerAlias xxxxxxxxxxx.com
    ProxyPass / http://192.168.1.130:8080/
    ProxyPassReverse / http://192.168.1.130:8080/

</VirtualHost> 

</IfModule>

我在做什么错了?

0 个答案:

没有答案