server {
    server_name vpn.51yanmei.com;

    location / {
        proxy_pass http://127.0.0.1:8899;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $http_cf_connecting_ip;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }

    listen 127.0.0.1:8443 ssl;
    ssl_certificate /etc/letsencrypt/live/vpn.51yanmei.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/vpn.51yanmei.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
    if ($host = vpn.51yanmei.com) {
        return 301 https://$host$request_uri;
    }

    listen 80;
    server_name vpn.51yanmei.com;
    return 404;
}
