# 启优学官网：HTTP 统一跳转至 HTTPS 主域名。
server {
    listen 80;
    server_name qiyouxueedu.com www.qiyouxueedu.com;
    return 301 https://qiyouxueedu.com$request_uri;
}

server {
    listen 443 ssl http2;
    server_name www.qiyouxueedu.com;
    ssl_certificate /etc/nginx/certs/qiyouxueedu.com.fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/qiyouxueedu.com.certkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    return 301 https://qiyouxueedu.com$request_uri;
}

server {
    listen 443 ssl http2;
    server_name qiyouxueedu.com;
    ssl_certificate /etc/nginx/certs/qiyouxueedu.com.fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/qiyouxueedu.com.certkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_session_cache shared:QIYOUXUE:10m;
    ssl_session_timeout 1d;
    ssl_session_tickets off;
    client_max_body_size 28m;

    location / {
        proxy_pass http://127.0.0.1:8793;
        proxy_http_version 1.1;
        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;
        proxy_set_header X-Forwarded-Host $host;
    }
}
