글 목차
728x90
이 글은 https://okane-on-cliff.tistory.com/302에서 이어짐
aws EC2에 nginx를 통한 https
일단 시작하기 전에 도메인을 구해요 https://www.duckdns.org/domains Duck DNS Duck DNS free dynamic DNS hosted on AWS news: login with Reddit is no more - legal request support us: become a Patreon www.duckdns.org 해당 웹사이트에서 도
okane-on-cliff.tistory.com
/etc/nginx/sites-enabled/conf
server {
location /api {
proxy_pass http://localhost:9999/api;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/minesweeping.duckdns.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/minesweeping.duckdns.org/privkey.pem; # managed by Certbot
# include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = minesweeping.duckdns.org) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name minesweeping.duckdns.org;
return 404; # managed by Certbot
}
이 내용 만으로는 웹소켓서버를 구성할 수 없다.
추가해야될 내용이 있기 때문
location /api {
}
안에 추가로
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
을 추가해 줘야 된다.
그런데 이걸 붙혀넣기로 넣어서는 안된다.. 뭐지
이걸 직접치지 않으면 인코딩 상의 문제가 발생하는 것 같다. 직접 쳐주는 것으로 문제해결가능
^오^
728x90