# 智引未来官网正式域名：HTTP 统一跳转到 HTTPS 和 www 主域名。
server {
    listen 80;
    server_name zhiyintec.com www.zhiyintec.com;
    return 301 https://www.zhiyintec.com$request_uri;
}

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

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

    location / {
        proxy_pass http://127.0.0.1:8792;
        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;
    }
}
