Your question is not clear on the requirement or the technologies your using so I will make the assumption that you are trying to secure your application using https on port 443. You would like your app to be accessed at url something like https://www.mysite.com/app?
If you are wanting to get a https web server up, you can use elements of this recipe. Note, download the install.sh file for the actual commands. The recipe is for Ubuntu, Apache + Tomcat + mod-jk and Lets Encrypt (for certs) and it’s a recipe so you will use the pieces needed for your requirement.
You do not have to anything special in your gradle.build as Apache handles the ssl certs and mod-jk will communicate from Apache to Tomcat. i.e. Apache uses https on port 443 and Tomcat runs using http on port 8080. Apache is a reverse proxy with mod-jk connecting Apache to Tomcat.