利用 Nginx443 端口 转发到 8000 端口上的 Frps 服务。

server {
    listen 80;
    server_name *.51simple.com;
    if ( $http_host ~* "^(.*)\.51simple\.com$") {
        set $domain $1;
        rewrite ^(.*) https://$domain.51simple.com/ break;
    }
}

server {
    listen 443 ssl http2;
    server_name *.51simple.com;

    ssl_certificate "/etc/nginx/ssl/51simple.com.crt";
    ssl_certificate_key "/etc/nginx/ssl/51simple.com.key";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;
    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header    Host            $host:443;
        proxy_set_header    X-Real-IP       $remote_addr;
        proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_hide_header   X-Powered-By;
    }
}

preView