Skip to content

Instantly share code, notes, and snippets.

@moreati
Created February 24, 2025 11:26
Show Gist options
  • Save moreati/876ce713090a8977ee879d07c93854e5 to your computer and use it in GitHub Desktop.
Save moreati/876ce713090a8977ee879d07c93854e5 to your computer and use it in GitHub Desktop.
Plain http proxy for https://vault.centos.org using Apache httpd
DefaultRuntimeDir ${XDG_RUNTIME_DIR}
PidFile ${XDG_RUNTIME_DIR}/apache2.pid
LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so
LoadModule authz_core_module /usr/lib/apache2/modules/mod_authz_core.so
LoadModule mpm_event_module /usr/lib/apache2/modules/mod_mpm_event.so
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
KeepAlive On
Listen 8090
<Directory />
Require all denied
AllowOverride None
</Directory>
<VirtualHost *:8090>
ServerName centos-vault-proxy
SSLProxyEngine On
CustomLog access.log vhost_combined
ProxyPass "/" "https://vault.centos.org/"
ProxyPassReverse "https://vault.centos.org/" "/"
RedirectMatch "^/(.*)" "http://centos-vault-proxy:8090/$1"
</VirtualHost>
# /usr/sbin/apache2 -d . -f apache_proxy.conf -D FOREGROUND
# vim: syntax=apache
[base]
name=CentOS-$releasever - Base
baseurl=http://centos-vault-proxy:8090/5.11/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[updates]
name=CentOS-$releasever - Updates
baseurl=http://centos-vault-proxy:8090/5.11/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[extras]
name=CentOS-$releasever - Extras
baseurl=http://centos-vault-proxy:8090/5.11/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
[libselinux]
name=CentOS-$releasever - libselinux
baseurl=http://centos-vault-proxy:8090/5.11/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
includepkgs=libselinux*
@moreati
Copy link
Author

moreati commented Feb 24, 2025

Runs on Debian 11. DNS entry or /etc/hosts entry should be added for centos-vault-proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment