- Newest
- Most votes
- Most comments
Hello Please find the below document,
https://repost.aws/knowledge-center/acm-certificate-error-https
Hello,
Please try this solution.
Modifying your Nginx configuration to redirect HTTP traffic to HTTPS.
Step 1 Edit Nginx Configuration:
Use a text editor like Vi or Nano to open your Nginx configuration file. The location might vary, but it's typically /etc/nginx/nginx.conf or /etc/nginx/sites-available/<your_domain_name>.conf
sudo vi /etc/nginx/nginx.conf
Step 2 Modify Server Block:
Locate the server block for your website. This block should have lines defining server_name and potentially location /.
Step 3 Add Redirect Rule:
- If you only have one website, modify the `listen` directive within the server block:
server {
listen 80 443 ssl; # Listen on both ports (HTTP and HTTPS)
# ... other server block configuration ...
}
**Important:** Add `ssl` after port 443 to indicate an HTTPS connection.
Step 4 Save and Restart:
Save your changes (Ctrl+:+w+q+! followed by Enter in VI).
Restart Nginx to apply the new configuration
sudo systemctl restart nginx
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/configuring-https-httpredirect.html
Relevant content
- asked a year ago
- asked 5 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a month ago
Ensure your ALB Has a rule to redirect traffic from PORT 80 to 443