HTTPS Single Instance Elastic Beanstalk Linux2023 setup

0

I've been looking at guides, but there seems to be a lot of contradictory information. I am testing out aws and want to create a https backend. I'm using tomcat(spring boot) and have deployed successfully to Elastic Beanstalk on port 5000 with http. My environment says Corretto 17 running on 64bit Amazon Linux 2023/4.1.1. The domain follows this format: my-api.region.elasticbeanstalk.com.

I'm reading through the following documentation and have some questions: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https.html https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-tomcat.html

First question. In the second link above, the docs say to create the following file: ".ebextensions/httpd/conf.d/ssl.conf". I've seen many tutorials say I should place this instead at the following location: ".platform/nginx/conf.d/ssl.conf". Which one is correct. Right above that section in the documentation there is a note about configuring your Tomcat environment proxy server. Am I supposed to do this or not? Is this why the documentation doesn't place the ssl.conf file under nginx? Is it because I'm supposed to create a "tomcat-settings.config" file and set the ProxyServer to "apache"? (Instead of the default nginx)?

Second. In the ssl.conf file. What is "server-name"? is that localhost or is it my domain? ("my-api.region.elasticbeanstalk.com") Further, in the same ssl.conf file, there are two lines ProxyPass and ProxyPassReverse. Do I leave these at localhost:8080 or at localhost:5000. Do I keep my tomcat Port set to 5000 and these at localhost:8080?

The rest of the setup seems clear and in agreement with most other tutorials. Setting, the security group config and the https certificates.

clark
asked 6 months ago273 views
1 Answer
0
Accepted Answer

I figured this out.

First I should use the Java instructions and not Tomcat. https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-java.html and the ssl.conf file should go in the .platform location. ".platform/nginx/conf.d/ssl.conf" contrary to what the documentation says.

The second question when using the Java instructions only asks for a port. And that should be 5000.

The other issue I had but didn't realize was that the ",ebextensions" and ".platform" folders were not being uploaded to aws S3. So I updated the deployment instructions to include those two files in the .zip file containing the jar.

clark
answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions