Skip to content

Tom-Fawcett/imgur-unblock-uk

Repository files navigation

imgur-unblock-uk

Unblocks imgur.com for your home network in the UK by proxying through a WireGuard VPN tunnel.

Background

In September 2025 Imgur chose to block all UK visitors. This cut off access to a large volume of everyday image content (memes, screenshots, photos) widely linked from Reddit and other sites.

This project routes imgur.com traffic through a VPN exit point outside the UK, bypassing the block.

Benefits

  • Allows you to unblock imgur for your whole home network without installing a VPN on every device.
  • Only applies to imgur traffic.

Is this the right approach for you?

This project requires a dedicated Linux server. If your router natively supports a VPN and policy-based routing by domain name (some Firewalla, Ubiquiti, pfSense, and OPNsense devices can do this), that is a simpler solution - the router handles everything without a separate server.

How it works

Browser → DNS (imgur.com → $nginx_ip) → nginx on your server → WireGuard VPN tunnel → imgur.com

Your home DNS resolves imgur.com to your local server. nginx receives the request and forwards it to imgur.com, with WireGuard routing ensuring nginx's traffic exits via a VPN that is not blocked by Imgur.

Requirements

  • An Ubuntu Linux server on your home network to run nginx and WireGuard on.
  • A configurable DNS server on your home network (e.g. Ubiquiti EdgeRouter, Pi-hole).
  • A VPN provider that:
    • Supports WireGuard
    • Is not blocked by Imgur - your traffic exits via their IP, so it must be reachable from Imgur's servers
    • Note: commercial VPN providers normally cost money.

Your provider will supply the WireGuard credentials needed during setup. The exact fields vary by provider - for example, some provide a PresharedKey and some do not.

Tested on Ubuntu 22.04.5 LTS.

Note: This solution handles IPv4 only.

Known Issues

Chrome Local Network Access prompt - On websites that embed imgur images (e.g. Reddit), Chrome may display a "Allow [site] to access devices on your local network?" permission prompt. This is triggered by Chrome's Private Network Access policy, which detects that a public website is loading resources from a private IP address (your nginx server). Clicking Allow resolves it. This prompt is per-site and Chrome remembers the decision.

Future

EdgeRouter ipset-based routing - This project works around the EdgeRouter's lack of domain-based policy routing by using a Linux server running nginx as a proxy. A more elegant future approach could be to use ipset on the EdgeRouter itself: DNS responses for imgur.com would dynamically populate an ipset, and policy-based routing rules would forward traffic to those IPs through the VPN - eliminating the need for a separate server entirely.


1. Install nginx (1.27.3+)

nginx acts as a TCP SNI proxy, forwarding requests to imgur.com. WireGuard routing ensures nginx's outbound traffic exits via the VPN.

Version 1.27.3 or newer is required for the resolve parameter on server directives inside upstream blocks, which ensures imgur.com's IP is re-resolved dynamically rather than cached at startup. Without dynamic re-resolution, the cached IP would point back to nginx itself and cause a routing loop.

Ubuntu 22.04's default apt repos ship an older nginx. Install from the nginx official repo instead:

sudo apt install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring

curl https://nginx.org/keys/nginx_signing.key \
  | gpg --dearmor \
  | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null

echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
https://nginx.org/packages/mainline/ubuntu $(lsb_release -cs) nginx" \
  | sudo tee /etc/apt/sources.list.d/nginx.list

echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
  | sudo tee /etc/apt/preferences.d/99nginx

sudo apt update && sudo apt install -y nginx

2. Install WireGuard

sudo apt install -y wireguard

3. Download config files

sudo apt install -y git
git clone https://github.com/Tom-Fawcett/imgur-unblock-uk.git
cd imgur-unblock-uk

The remaining steps assume you are running commands from inside this directory.


4. Deploy config files

# nginx reverse-proxy config - SNI proxy that re-resolves imgur.com dynamically
sudo install -m 644 nginx.conf /etc/nginx/nginx.conf

# WireGuard tunnel config - contains private key, keep permissions tight
sudo install -m 600 wg-imgur.conf /etc/wireguard/wg-imgur.conf

# nftables rules - marks nginx's outbound traffic so it uses the VPN routing table
sudo install -D -m 644 nftables-wg-imgur.nft /etc/nftables.d/wg-imgur.nft

# Prevents systemd-networkd from deleting the ip rule added by wg-imgur PostUp
sudo install -D -m 644 10-preserve-routing-policy-rules.conf /etc/systemd/networkd.conf.d/10-preserve-routing-policy-rules.conf

5. Fill in VPN credentials

Edit the installed config and fill in the values provided by your VPN provider:

sudo nano /etc/wireguard/wg-imgur.conf
Config key Description Format
Address Your tunnel IP address <IP>/32
PrivateKey Your WireGuard private key Base64 string
PublicKey VPN server public key Base64 string
PresharedKey Preshared key (if not provided by your VPN provider, delete this entire line) Base64 string
Endpoint VPN server address and port hostname:port

6. Start services

sudo systemctl restart nginx
sudo systemctl enable --now wg-quick@wg-imgur

7. Configure firewall

If ufw is active, allow inbound HTTPS from your local network:

# Check whether ufw is active
sudo ufw status

# If active, allow TCP 443 from your local subnet
# (adjust subnet to match your network)
sudo ufw allow from 192.168.1.0/24 to any port 443 proto tcp
sudo ufw reload

If ufw is inactive, no action is needed.


8. Test

Verify nginx's traffic is exiting via the VPN. The IP returned should be your VPN provider's exit IP, not your home IP:

sudo -u nginx curl -s https://icanhazip.com

Verify imgur loads through the proxy when overriding DNS:

curl -v --resolve "imgur.com:443:127.0.0.1" https://imgur.com

A successful TLS handshake and HTTP response confirms the full chain is working.


9. Configure DNS

Configure your home network's DNS so that imgur.com resolves to your server's local IP instead of imgur's real IP.

Replace 192.168.1.10 with the IP address of the server running nginx.

The example below is for a Ubiquiti EdgeRouter (dnsmasq). A common alternative is Pi-hole.

SSH to EdgeRouter and then:

configure
set service dns forwarding options address=/imgur.com/192.168.1.10 # root domain plus all subdomains
commit
sudo service dnsmasq restart
show service dns forwarding
save
exit

10. Test end-to-end

On a device connected to your home network:

  1. Confirm imgur.com resolves to your server: nslookup imgur.com or dig imgur.com should return 192.168.1.10 (or your equivalent).
  2. Open https://imgur.com in a browser - it should load normally.

If DNS looks correct but the browser fails, recheck the server-side test in step 8.

About

Unblock imgur.com via WireGuard.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors