아마존 라이트세일 nginx사용중이고


인증서 설치하고 도메인 접속 가능함


http랑  https 도메인 각각 접속해보면 인증서 잘 작동중이라


http접속을 https로 넘겨줄라는데


아마존 설명서 대로 bitnami.conf에 return 301 https://$host$request_uri; 추가하고 


nginx 재부팅 해봤는데 안됨;;



뭐가 문제일까 


아래는 conf 내용임




    # HTTP server


    server {

        listen       80;

        server_name  localhost;


        include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";

        return 301 https://$host$request_uri;      


        include "/opt/bitnami/nginx/conf/bitnami/bitnami-apps-prefix.conf";

    }


    # HTTPS server


    server {

       listen       443 ssl;

       server_name  localhost;


       ssl_certificate      server.crt;

       ssl_certificate_key  server.key;


       ssl_session_cache    shared:SSL:1m;

       ssl_session_timeout  5m;


       ssl_ciphers  HIGH:!aNULL:!MD5;

       ssl_prefer_server_ciphers  on;

       

         location / {

            root   html/build;

            index  index.html index.htm;

            try_files $uri /index.html;

  proxy_cookie_path / "/; secure; SameSite=None";

   }

 

       include "/opt/bitnami/nginx/conf/bitnami/phpfastcgi.conf";


       include "/opt/bitnami/nginx/conf/bitnami/bitnami-apps-prefix.conf";

    }



    include "/opt/bitnami/nginx/conf/bitnami/bitnami-apps-vhosts.conf";