What Can I Do If wget Does Not Recognize the no_proxy Wildcard?
Symptom
In wget 1.20 or earlier, the wildcard (for example, *.obs.com) configured in the no_proxy environment variable does not take effect. As a result, download requests are still sent through the proxy server.
- no_proxy: environment variable, which specifies the list of domain names that do not need to be accessed through the proxy server.
- Wildcards: For example, * matches any character (for example, *.obs.com matches a.obs.com, b.obs.com, and more).
Possible Causes
- wget 1.20 and earlier versions do not support the no_proxy wildcard, and cannot correctly match domain names in the *.obs.com format.
- The wget version of some systems (such as RHEL 8) ignores the wildcard configuration in no_proxy.
Solution
- Configure Complete Domain Names List the full domain names that need to bypass the proxy in no_proxy (for example, no_proxy='obs.com,sub.obs.com'), avoiding the use of wildcards.
# Example: Temporarily set environment variables export no_proxy="obs.com,sub.obs.com"
- Use curl Instead
The curl command supports the no_proxy environment variable and its syntax is compatible with wget.
curl -O https://xxx.obs.com/file # Direct download, bypassing the proxy
- Upgrade wget Version
Upgrade the wget version to 1.20 or above. If upgrading is challenging, consider switching to an image with a pre-installed wget version 1.20 or higher.
Temporary workaround: Simply disable the proxy by clearing the proxy environment variables (unset http_proxy https_proxy) to force all domains to bypass the proxy.
Checking Whether the Wildcard Issue Is Solved
- Check the current proxy configuration.
env | grep -i proxy
- Check the download logs to determine whether the proxy is bypassed.
wget --debug https://xxx.obs.com/file
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot