server {
listen 80;
server_name *.compute.amazonaws.com;
charset utf-8;
client_max_body_size 128M;
location / {
uwsgi_pass unix:///tmp/mysite.sock;
include uwsgi_params;
}
# 여기서부터
if ($http_x_forwarded_proto = 'http'){
return 301 https://$host$request_uri;
}
# 여기까지
}
$ sudo systemctl daemon-reload && sudo systemctl restart nginx uwsgi