When developing a grails application, it is acceptable to hard code the database connection in DataSource.groovy. But when you want to create a war and deploy it on an application server, it is better to use JNDI. This is more flexible because you can change the connection property in the application server, instead of creating a new war.
NGINX is an awesome software that functions as both web server and as a reverse proxy. Sometimes you may need to configure it in front of your tomcat or other application server. There are many reasons but here are some common ones: