Search code examples
tomcatgrailsgrails-3.0grails-3.1

Grails 3 - Configure embedded Tomcat bind address


I am running my Grails 3.1.3 application as standalone JAR using the embedded Tomcat servlet container and start the WAR by the following command:

java -jar -server -Dserver.host=127.0.0.1 -Dserver.port=50000 -Dgrails.env=prod -Xmx768M myApp.war

By using the server.port I successfully managed to set the Tomcat listening port to 50000. But the server.host does not seem to set Tomcats bind address to 127.0.0.1 since it is visible from the Internet.

Is there a way to successfully set the bind address?


Solution

  • The question has been answered here. Simply use the property server.address to set the bind address.