More example config
authorJames Bunton <jamesbunton@delx.net.au>
Fri, 5 Oct 2012 09:04:56 +0000 (19:04 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Fri, 5 Oct 2012 09:04:56 +0000 (19:04 +1000)
ruby/lighttpd.conf [new file with mode: 0644]
ruby/path.cgi

diff --git a/ruby/lighttpd.conf b/ruby/lighttpd.conf
new file mode 100644 (file)
index 0000000..9230f53
--- /dev/null
@@ -0,0 +1,6 @@
+$HTTP["host"] == "public.example.com" {
+       url.rewrite-once = (
+               "^/(.*)" => "/path.cgi/$1",
+       }
+}
+
index 108d1f5..69f338e 100755 (executable)
@@ -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}"