-
-
Save zjhuntin/288eb310da52d1150e5d4aa52b4e025b to your computer and use it in GitHub Desktop.
Gen virt host proxies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
base=8000 #port | |
range="192.168.121." | |
contents = <<-EOS | |
Listen %{port} https | |
<VirtualHost *:%{port}> | |
ProxyPass / https://%{ip_address}/ | |
<Location /> | |
ProxyPassReverse https://%{ip_address}/ | |
</Location> | |
SSLEngine on | |
SSLCertificateFile /etc/pki/tls/certs/localhost.crt | |
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key | |
ProxyPreserveHost on | |
SSLVerifyClient none | |
SSLProxyEngine On | |
SSLOptions +StdEnvVars +ExportCertData +FakeBasicAuth | |
SSLProxyVerify none | |
SSLProxyCheckPeerCN off | |
SSLProxyCheckPeerName off | |
SSLProxyCheckPeerExpire off | |
</VirtualHost> | |
EOS | |
255.times do |count| | |
filename = "virt_hosts/virt_host_#{count}.conf" | |
ip_address = "#{range}#{count}" | |
file_contents = contents % {:ip_address => ip_address, :port => (base+count)} | |
File.open(filename, 'w') { |file| file.write(file_contents) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment