server {
    listen 80;
    server_name rebreak.org www.rebreak.org;
    return 301 https://rebreak.org$request_uri;
}

server {
    listen 443 ssl;
    server_name rebreak.org;

    ssl_certificate     /etc/letsencrypt/live/rebreak.org/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/rebreak.org/privkey.pem;

    location / {
        auth_basic "ReBreak – Coming Soon";
        auth_basic_user_file /etc/nginx/.htpasswd-rebreak;

        client_max_body_size 10m;
        proxy_pass http://127.0.0.1:3015;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
