0

Would like to set up Scalatra to run on a box running nginx.

Already have nginx set up correctly, and am able to serve static html pages, however, I now wish to point it to a Scalatra app. All of the documents available appear to assume that the server used will be Jetty: for example - http://blog.everythings-beta.com/?p=430

I assume that I cannot simply point it to just the folder because the jetty configuration requires, in addition to this, a class name and a servlet mapping.

How to I configure nginx to point to a Scalatra app?

Thanks!


Additional Info:

Ubuntu 12.04 is my operating system - so answers may either be specific to this, or anything that would generally work on Linux.


Bonus:

Throw in MongoDB as well - i.e. how to set up nginx with Scalatra and MongoDB - into your answer for extra points!!

Community
  • 1
  • 1
bguiz
  • 27,371
  • 47
  • 154
  • 243
  • 1
    Not a great question as google is your friend here, but I supplied an answer pointing to the documentation for nginx and casbah, that should suffice to get you up and running – Ross Jul 11 '12 at 14:18
  • @Ross : Ah, I did come across these when searching, however, I was specifically leaving out stuff that used Jetty. I take it that this means that it is impossible to use nginx to serve scala apps directly? (sorry, for the newbie question, btw) – bguiz Jul 11 '12 at 21:42
  • No you need to a java webserver to run it then you can proxy via nginx – Ross Jul 13 '12 at 08:28

1 Answers1

3

Setting up with nginx is easy check out the docs on deploying java servers.

Once you are up and running install casbah and you are up and running.

Ross
  • 17,861
  • 2
  • 55
  • 73
  • i love the sentence "Once you are up and running install casbah and you are up and running."... it's a little circular but so typical – rloth Nov 23 '16 at 10:38