我正在通过指令ProxyPass和ProxyPassReverse一些网址在 apache 中设置一个代理:
ProxyPass /mypath http://myotherserver.com
ProxyPassReverse /mypath http://myotherserver.com
Run Code Online (Sandbox Code Playgroud)
但是,myotherserver.com需要(基本)身份验证。如果我什么都不做,这个身份验证就会传递给最终的客户端。出于某种原因,我不希望这样,我想直接在我的 apache 配置中添加凭据。我怎样才能做到这一点 ?我试过:
ProxyPass /mypath http://user:pass@myotherserver.com
ProxyPassReverse /mypath http://user:pass@myotherserver.com
Run Code Online (Sandbox Code Playgroud)
但它似乎不起作用。在此先感谢您的帮助。