study/server
nginx http를 https로 리다이렉션
땅콩잉
2021. 10. 22. 19:24
728x90
nginx 서버 사용중인데 http로는 접근 못하게 해야했다.
그래서 http로 들어오면 https로 보내게끔 하기로 함.
다음 파일 수정
[root@admin ~]# vi /etc/nginx/conf.d/default.conf
이 파일의 윗 부분에 추가 ㅋㅋ
server{
listen 80;
return 301 https://$host$request_uri;
}
아주 잘 된다~