diff --git a/docs/troubleshooting/index.md b/docs/troubleshooting/index.md index 815504390..0825eb0b2 100644 --- a/docs/troubleshooting/index.md +++ b/docs/troubleshooting/index.md @@ -81,3 +81,15 @@ services: sysctls: - net.ipv6.conf.all.disable_ipv6=1 ``` + +## Running homepage behind a proxy + +If you are running homepage behind e.g. squid proxy, you can set the environment variable `HOMEPAGE_HTTP_PROXY_URL` to the URL of your proxy. This will allow homepage to use the proxy for all outgoing requests. + +```yaml +services: + homepage: + ... + environment: + - HOMEPAGE_HTTP_PROXY=http://proxy.local:3128 +``` diff --git a/src/utils/proxy/http.js b/src/utils/proxy/http.js index c5fa51183..1feaf5780 100644 --- a/src/utils/proxy/http.js +++ b/src/utils/proxy/http.js @@ -110,7 +110,7 @@ export async function cachedRequest(url, duration = 5, ua = "homepage") { export async function httpProxy(url, params = {}) { const constructedUrl = new URL(url); - const proxyUrl = process.env.HOMEPAGE_HTTP_PROXY_URL; // e.g., http://proxy.local:3128 + const proxyUrl = process.env.HOMEPAGE_HTTP_PROX; // e.g. http://proxy.local:3128 const disableIpv6 = process.env.HOMEPAGE_PROXY_DISABLE_IPV6 === "true"; const agentOptions = disableIpv6 ? { family: 4, autoSelectFamily: false } : {};