Nginx selective forwarding to tomcat

Nginx selective forwarding I encountered a situation¬†today where Nginx had to forward all requests to tomcat except couple of URL’s which will be served by static content located inside Nginx root folder. This is what I did:   server { server_name...

Grails Logical Delete Plugin

I was looking at recently updated plugins and got to know about grails Logical Delete Plugin. The name in itself was very interesting and i thought i should give it a shot. You can find the sample project here. Please checkout working demo of code on heroku by...

Hosting multiple websites on Nginx

This post is an extension to my previous post on Nginx where we learned how to set up SSL on Nginx and forward connections to tomcat which was running on 8080. This time we need to host another website on this same server let’s see how we can get it done. FYI i...

SSL on Nginx

Last week i was installing SSL certificate on an Nginx server which was acting as front-end for tomcat and the basic set up was that our Grails WAR file was deployed in tomcat which was running on port 8080 and Nginx server was running on port 80. We ordered SSL...

Redirect apache to tomcat using mod_proxy

Whenever i configure a new server i usually end up searching for this problem. How to redirect apache to tomcat ? There are various solutions out there but for now i am going to talk to about the easy one. Here are the steps : Assumption : It is assumed that you have...

How to create MongoDB indexes ?

In simple words “indexes are used to speed up query performance”. Let’s say you have a query which takes around 120ms to execute without indexes i can assure you that with proper indexes you can reduce that time by at least 10 times. Let me show you...

How to delete MongoDB document ?

In this blog post i am going to explain how to delete MongoDB document. The are few ways which are illustrated below : If we execute remove on collection without any params then it will delete all records db.users.remove({}) // it will delete all documents along with...

How to drop a field from a MongoDb document ?

In this blog post we are going to see how to drop a field from a MongoDb document ? For people coming from RDBMS you must be remembering the alter table command for dropping/adding columns in a table. In MongoDB it is possible to do this operation on some of the...

Updating multiple documents in MongoDB

In this blog post we are going to learn the process of updating multiple documents in MongoDB. MongoDB provides us with update() function to achieve the same. Here are few use cases : db.users.find(); { "_id" : ObjectId("537da62d770359c2fb4668e2"),...

MongoDB : Difference between save and insert

MongoDB uses save and insert option for adding new records in the database. Let me explain the difference between two : Insert : insert is used to add a document in a mongodb collection Save : save is used to add as well as update a document in a mongodb collection....