# HTTP
server {
    listen 80;
    server_name qcw1977.cn www.qcw1977.cn;
    location /.well-known/acme-challenge/ { root /var/www/certbot; }
    location / { return 301 https://$host$request_uri; }
}

# HTTPS
server {
    listen 443 ssl;
    server_name qcw1977.cn www.qcw1977.cn;
    
    ssl_certificate /etc/letsencrypt/live/www.qcw1977.cn/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/www.qcw1977.cn/privkey.pem;
    
    # 社区验证的微信兼容配置
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;

    location /dl/ { alias /home/admin/parking-mini-program/; autoindex on; }
    location /e1b0b365/ { proxy_pass http://127.0.0.1:15566; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; }
    location /api/ { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; proxy_set_header Host $host; }
    location / { proxy_pass http://127.0.0.1:8088; proxy_http_version 1.1; proxy_set_header Host $host; }
}
