# HTTP redirect
server {
charset utf-8;
client_max_body_size 128M;
listen 80;
server_name *.somesite.ru;
return 301 https://somesite.ru$request_uri;
}
# HTTPS 443
server {
listen 443 ssl http2;
server_name somesite.ru *.somesite.ru;
ssl_certificate /etc/ssl/somesite.crt;
ssl_certificate_key /etc/ssl/somesite.key;
# reverse proxy
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header remote_addr $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
}
}