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:

You just need to restart Nginx after changing this configuration and localhost/calendar will be served by Nginx and it will not be forwarded to tomcat.

I am no expert in Nginx but I get the job done. If there is a better way to do it please let me know in comments. Hope it helps.

Check out this link for more posts related to Nginx