[b]"How to properly configure wget proxy in /etc/wgetrc?"[/b] or [b]"Best way to set up wget proxy via /etc/wgetrc

18 Replies, 514 Views

"Why isn't my wget proxy /etc/wgetrc working? Pls help!"

Hey guys,

So I’ve been trying to set up a wget proxy in /etc/wgetrc, but it’s just not taking the settings. I added these lines:

```
http_proxy = http://myproxy:8080
https_proxy = http://myproxy:8080
```

But wget still ignores it and goes direct. Am I missing something?

Also, do I need to restart anything after editing /etc/wgetrc? Or is there some hidden syntax rule?

Kinda frustrating lol. Any tips?

---

*Or a shorter version:*

"Correct syntax for wget proxy /etc/wgetrc?"

Quick q: what’s the right way to set a wget proxy in /etc/wgetrc?

Tried a few formats but no luck. Does it need quotes? Full URL?

Thx!
Hey, had the same issue last week! Turns out /etc/wgetrc needs root permissions to edit, and sometimes the file is read-only. Did you use sudo when editing? Also, check if there’s a .wgetrc in your home dir overriding it.

Try running `wget --debug` to see if it’s even reading the proxy settings. Might give you a clue.
Yo, you might wanna try this format instead:

```
use_proxy = on
http_proxy = http://myproxy:8080/
https_proxy = http://myproxy:8080/
```

The trailing slash and `use_proxy` line sometimes make a difference. Also, no restart needed—wget reads it on the fly.
Check if your proxy requires auth! If it does, you’ll need to add:

```
proxy_user = your_username
proxy_password = your_password
```

Btw, if you’re on a shared system, /etc/wgetrc might be locked down. Try ~/.wgetrc instead.
Had this exact problem. Two things:

1. Make sure there’s no typo in the proxy URL. Even a missing colon or wrong port breaks it.
2. Some distros ignore /etc/wgetrc unless you force it. Try `wget --no-check-certificate` to see if it’s a SSL issue.
Lol, wget proxy /etc/wgetrc can be finicky. Did you check the file permissions? Run `ls -l /etc/wgetrc` to see if it’s readable by your user.

Also, maybe your proxy’s just down? Test with `curl -x http://myproxy:8080 http://example.com` to rule that out.
Forget /etc/wgetrc for a sec—have you tried env vars?

```
export http_proxy=http://myproxy:8080
export https_proxy=http://myproxy:8080
```

Then run wget. If that works, your /etc/wgetrc might be ignored by config precedence.
Man, wget proxy /etc/wgetrc issues are the worst. Double-check if your proxy supports HTTP—some only do HTTPS. Also, maybe your network’s blocking non-proxy traffic?

Try `strace wget http://example.com 2>&1 | grep proxy` to see if wget even tries to use it.
Quick tip: some systems load /etc/wgetrc.d/*.conf instead of /etc/wgetrc. Check if that’s the case for you.

Also, if you’re behind a corporate proxy, they might force their own settings. Annoying, but worth asking IT.
Hey, thanks for all the suggestions! Turns out my /etc/wgetrc was write-protected—had to sudo edit it. Also, the proxy needed auth, which I totally missed.

One last q: does wget cache proxy settings? Had to reboot to make it stick, which seems weird.

(And yeah, the `use_proxy = on` line fixed it. Thx!)



Users browsing this thread: 1 Guest(s)