Proxy access to github.com for computers in restricted network environment.
- You have your own domain where multiple subdomains can be added.
- Your server has port 80 and 443 available and can be access from the Internet.
The following subdomain should be added. Replace yourdomain.example.com
with your own domain.
yourdomain.example.com
blackhole.yourdomain.example.com
assets.yourdomain.example.com
avatars.yourdomain.example.com
raw.yourdomain.example.com
camo.yourdomain.example.com
codeload.yourdomain.example.com
releases.yourdomain.example.com
user-images.yourdomain.example.com
objects.yourdomain.example.com
Your can use wildcard if your service provider allows it.
Extract the package on your server and set the "execute" attribute.
chmod +x GitHubProxy
You can also modify the Urls
field to control which port the proxy will listen on. For example, change it to http://localhost:9000
will listen on port 9000
.
This is the systemd config file for example.
[Unit]
Description=GitHub Proxy
[Service]
Type=notify
WorkingDirectory=/opt/github_proxy
ExecStart=/opt/github_proxy/GitHubProxy
[Install]
WantedBy=multi-user.target
apt update
apt install caddy
Modify caddy file to forward requests for the domains you have configured in Step 1.
http://yourdomain.example.com {
redir https://{host}{uri}
}
https://yourdomain.example.com {
reverse_proxy 127.0.0.1:9000
}
# other domains omitted
systemctl enable caddy
systemctl daemon-reload
systemctl restart github-proxy
systemctl restart caddy