簡體   English   中英

如何在mod_proxy設置下在Apache的http.conf中引用環境變量

[英]How can I reference environment variable in http.conf of Apache under mod_proxy settings

如何在mod_proxy設置下在Apache的http.conf中引用環境變量? 我將targetserver設置為環境變量,但是apache mod_proxy無法解析。 有什么想法嗎?

Configuration:
ProxyPass /lac/ http://${targetserver}/

從服務器收到錯誤消息

The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /lac/.
Reason:
DNS lookup failure for: ${targetserver}
Apache/2.2.15 (CentOS) Server at localhost Port 80

我使用Apache / 2.4.12,並且可以使用$ {ENV_VARIABLE_NAME}訪問環境變量,例如:$ {targetservername}

服務器版本:Apache / 2.4.12(Unix)

建置的伺服器:2015年4月28日10:58:48

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM