From: James Bunton Date: Fri, 5 Oct 2012 09:04:56 +0000 (+1000) Subject: More example config X-Git-Url: https://code.delx.au/cgiproxy/commitdiff_plain/916eebc685a7ba1517cf94b5bacdc26a6071adbe More example config --- diff --git a/ruby/lighttpd.conf b/ruby/lighttpd.conf new file mode 100644 index 0000000..9230f53 --- /dev/null +++ b/ruby/lighttpd.conf @@ -0,0 +1,6 @@ +$HTTP["host"] == "public.example.com" { + url.rewrite-once = ( + "^/(.*)" => "/path.cgi/$1", + } +} + diff --git a/ruby/path.cgi b/ruby/path.cgi index 108d1f5..69f338e 100755 --- a/ruby/path.cgi +++ b/ruby/path.cgi @@ -1,5 +1,10 @@ -#!/usr/bin/env ruby +#!/usr/bin/ruby require 'proxy.rb' -proxyTo "http://internalserver/somepath" +host = ENV["HTTP_HOST"] +case host +when "public.example.com" + host = "internal.example.com" +end +proxyTo "https://#{host}"