Our Blog

Let us find tech solutions together

Feb 06

Our signature sample is our “5 Days Of Wicket” tutorial app MysticPaste.com. And recently I decided to migrate the app from being proxied by Apache to nginx.

We have always backed the pastebin with Jetty and this hasn’t changed. Without further adieu here is our config for nginx:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
server {
  listen  80;
  server_name mysticpaste.com www.mysticpaste.com;

  access_log  /var/log/nginx/mysticpaste.com.access.log;

  location / {
    proxy_pass  http://127.0.0.1:8081/mysticpaste/;
    proxy_pass_header Set-Cookie;
    proxy_pass_header X-Forwarded-For;
    proxy_pass_header Host;
  }

}

So far so good. The app does essentially what we want, hosts in Jetty under the context path /mysticpaste while offering it up on the root path via nginx and our users. Under this configuration you’ll see a slight problem however, in that the cookie path isn’t being properly set due to the proxy. In Apache we would just use ProxyPassReverseCookiePath, but this doesn’t appear to be an option in nginx anywhere I could find.

Next best thing, add a context-param to our web.xml and change the SessionPath that Jetty uses to be root instead of /mysticpaste.

1
2
3
4
    <context-param>
        <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
        <param-value>/</param-value>
    </context-param>

All works as it did with Apache, and you get some nginx goodness mixed in.

Read more
Jan 10

So our little pastebin has been growing up lately! After playing the staring role in 5 days of Wicket as an example project, it’s been used as a public pastebin for almost two years. So as with all older stars, it was in dire need of a facelift.

You can click through to the picture above to see the new pastebin. Here is a quick list of some of the additions:

  • Implemented paste replies with automatic diff view + original
  • Original pastes will show all paste replies, and all paste replies have a link back to their original
  • Massive user interface clean up
  • Integrated SyntaxHighlighter 3.0
  • Implemented raw text view and download paste
  • Gradle-based build file (early testing)

Enjoy!

Read more
Dec 24

It’s the holiday season, and no matter how you celebrate - enjoy the present.

We Wish everyone Happy Holidays and a Safe and Fun New Year!

Read more