Erik Sapir
Erik Sapir

Reputation: 24717

Grails not listening to https port on production

I have the following configuration in BuildConfig.groovy: grails.server.port.https = 8443

However, when deploying my app (i use AWS OpsWorks) grails does not listen to this port. I see that following messages when grails app finishing load:

Sep 08, 2015 1:24:20 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Sep 08, 2015 1:24:20 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Sep 08, 2015 1:24:20 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 67150 ms

It tells me that the app is listening for http requests on port 8080 but i don't see anything regarding https. What should i do to make my grails app receive https requests?

Upvotes: 0

Views: 585

Answers (1)

Ramsharan
Ramsharan

Reputation: 2064

The configuration you used in the BuildConfig.groovy is used to run application using command grails run-app -https.

Since you are creating war for production and deploying the war in external tomcat, you need to configure the tomcat to listen https requests. In order to configure tomcat for https, please go through this tutorial

The detail about the configuration you used is :

In order to run application in https locally, we use command

grails run-app -https

This runs the application in port 8443 by default. There are two ways to change the port number.

  1. One way is as you did above in BuildConfig.groovy by adding grails.server.port.https = 8443
  2. Another way is to run application with command grails -Dserver.port=8443 run-app -https

You can change the port number to any like 8993.

Upvotes: 1

Related Questions