아마존 ELB 뒤에있는 EC2 시스템에서 실행중인 웹 사이트가 있습니다.
ELB에서 SSL을 구성하여 HTTP뿐만 아니라 https도 처리합니다. https에 대한 모든 요청이 완벽하게 작동합니다. 하지만 HTTP 요청을 https로 (리디렉션)하고 싶습니다. 어떤 이유로 든 작동하지 않습니다.nginx에서 http로 https 리디렉션
nginx에서 리디렉션 규칙을 추가했지만 해당 규칙을 사용할 때마다 nginx 서버가 응답을 중지합니다. 내가 구성을 잘못 하겠어 어디
이 제발 도와주세요 : 여기
server {
listen 80;
server_name domain1.com;
gzip on;
gzip_proxied any;
gzip_types text/plain text/xml text/css application/x-javascript;
gzip_vary on;
access_log /var/log/nginx/domain1.access.log;
location/{
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:4000/;
### Redirect http to https ####
if ($http_x_forwarded_proto != "https") {
rewrite ^(.*)$ https://$server_name$1 permanent;
}
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains;";
}
}
은로드 밸런서의 구성입니다. TIA.
은 사용하지 못할 어떤 이유는'301 HTTPS를 반환 있는가? –