Thanks Jo. The problem I have is that I have a bunch of hosts behind a single 
Apache server which ProxyForwards over SSL. My Apache FU isn’t great and I have 
only managed to get this to work if there is symmetry between the URL coming in 
and the context root on the machine being proxied, i.e. /server1 is proxied to 
something like http://my-server:3000/server1 <http://my-server:3000/server1>. 
/server1 being proxied to http://my-server:3000/ <http://my-server:3000/> 
doesn’t work.



> On 7 Jul 2015, at 15:23, Jo Geraerts <[email protected]> wrote:
> 
> I think you don't. 
> 
> But you can make a small piece of middleware that dispatches to a different 
> handler based on the 'context root'. You can also strip off the context root 
> as u dispatch the request to the correct handler. 
> 
> I'm doing something similar with virtual hosts. 
> 
> (ns net.umask.imageresizer.vhost)
> 
> (defn vhost-handler [vhosts]
>   (fn [request]
>     (let [hostname (:server-name request)
>           handler (get-in vhosts [hostname :handler])]
>       (if-not (nil? handler)
>         (handler request)
>         {:status 404
>          :body "vhost config not found"}))))
> 
> Hope you can work with this. 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en 
> <http://groups.google.com/group/clojure?hl=en>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to