Frage

I'm writing an angular/clojure ring webapp. All routes to the ring side will have an "/api" prefix and will be routed with compojure.

Serving upp all other static file with ring seems a bit messy though.

Is there a good way to direct "/api/whatever" requests to ring and all other to be served up as static files using jetty? or using any other major web server, like apache, nginx, lighttpd?

War es hilfreich?

Lösung

We put nginx infront of jetty and have nginx configured to serve the static stuff (actually redirects to a CDN) directly and proxy all the app stuff to jetty. In production jetty is running on a separate load balancer though this works out the same if they are running on the same instance.

Andere Tipps

If you want to run clojure Ring handlers with Nginx without any Java Web Server, eg. Jetty. please try Nginx-Clojure module.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top