具有基本身份验证的 Apache 反向代理 [英] Apache reverse proxy with basic authentication

查看:37
本文介绍了具有基本身份验证的 Apache 反向代理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将流量转发到我的后端服务器之前,尝试使用基本身份验证配置我的反向代理.谁能给我一个解决方案.

Trying to configure my reverse proxy with basic authentication before forward the traffic to my back end server. Can any one give me a solution.

示例:

用户(互联网)-> 反向代理/虚拟主机服务器(需要在此处添加基本认证)-> 后端服务器(未认证)

User(internet) -> reverse proxy / vhosts server (need to add basic authentication here ) -> back end server ( non authenticated )

推荐答案

您可以按照此处的说明进行操作:身份验证、授权访问控制.您的反向代理的主要区别在于您需要将身份验证内容放在 Location 块中,即使文档说它们只允许在 Directory 块中使用:

You can follow the instructions here: Authentication, Authorization and Access Control. The main difference for your reverse proxy is that you'll want to put the auth stuff inside a Location block, even though the docs say that they're only allowed in Directory blocks:

<Location />
    AuthType Basic
    ...
</Location>

在位置块之外,您可以放置​​代理命令,例如:

Outside the Location block you can put your proxy commands, such as:

ProxyPass / http://localhost:8080/

这篇关于具有基本身份验证的 Apache 反向代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆