0

I've been struggling and googling this issue for a while and although it seems to me like a pretty standard requirement I couldn't find a working solution anywhere.

I don't want to disable HTTP, only redirect it to HTTPS. Not between the load balancer and the EC2 instances, but between the browser and the load balancer.

I have created an Elastic Beanstalk environment (Linux) for my Spring Boot app, configured the load balancer for HTTP + HTTPS using the management console and configured environment variables and IP tables using .config files in an .ebextensions folder zipped with the app's JAR file.

Then I tried adding an NGINX configuration for a permanent HTTP to HTTPS redirect using a config file with a "files" key, but it doesn't seem to have any effect.

Thanks

4

1 回答 1

0

这是我重定向到 https 的 NGINX 配置:

# HTTP - redirect all requests to HTTPS
server {
    listen 80;
    listen [::]:80 default_server ipv6only=on;
    return 301 https://$host$request_uri;
}

试试看,如果不行,请粘贴您的 NGINX 配置文件

于 2016-07-22T17:11:56.433 回答