相关疑难解决方法(0)

Apache2反向代理到需要BasicAuth但想要从用户隐藏它的端点

基本上我的情况是我有一个内部网站,需要一个单一的硬编码用户名和密码才能访问(这不能关闭,只能更改).我出于各种原因通过反向代理公开这个网站(隐藏端口,简化网址,简化NAT等).

但是,我想要做的是能够使用Apache来处理身份验证,以便:

  1. 我没有给每个人发密码
  2. 我可以使用Apache的BasicAuth拥有多个用户名和密码
  3. 对于内部用户,我不必提示输入密码

编辑:关于更丰富的身份验证的第二部分已移至新问题

这或多或少是我现在所拥有的:

<VirtualHost *:80>
  ServerName sub.domain.com

  ProxyPass        / http://192.168.1.253:8080/endpoint
  ProxyPassReverse / http://192.168.1.253:8080/endpoint

  # The endpoint has a mandatory password that I want to avoid requiring users to type
  # I.e. something like this would be nice (but does not work)

  # ProxyPass        / http://username:password@192.168.1.253:8080/endpoint
  # ProxyPassReverse / http://username:password@192.168.1.253:8080/endpoint

  # Also need to be able to require a password to access proxy for people outside local subnet
  # However these passwords will be …
Run Code Online (Sandbox Code Playgroud)

apache reverse-proxy apache2 mod-proxy basic-authentication

20
推荐指数
2
解决办法
4万
查看次数