sudo vi frps.ini 
[common]
bind_port = 8888
dashboard_port = 9999
dashboard_user = admin
dashboard_pwd = *********
#subdomain_host = ppilab.com
vhost_http_port = 12369
vhost_https_port = 12399
#custom_404_page = http://404.ppilab.com
token = **************
sudo ./frps -c ./frps.ini
sudo apt install nginx
cd /etc/nginx
sudo mkdir pem
sudo vi server.crt
sudo vi server.key
sudo service nginx restart
server {
    listen 80;
    server_name ppilab.com *.ppilab.com;  

    location / {
        proxy_pass http://127.0.0.1:12369;
        proxy_redirect http://$host/ http://$http_host/;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
    }
}

server {
    listen 443 ssl http2;
    server_name ppilab.com *.ppilab.com;  

    ssl_certificate /etc/nginx/pem/server.crt;
    ssl_certificate_key /etc/nginx/pem/server.key;    

    client_max_body_size 50m;
    client_body_buffer_size 256k;
    client_header_timeout 3m;
    client_body_timeout 3m;
    send_timeout 3m;
    proxy_connect_timeout 300s;
    proxy_read_timeout 300s;
    proxy_send_timeout 300s;
    proxy_buffer_size 64k;
    proxy_buffers 4 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    proxy_ignore_client_abort on;

    location / {
        proxy_pass http://127.0.0.1:12369;
        proxy_redirect https://$host/ https://$http_host/;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_ssl_server_name on;
        proxy_set_header Host $host;
    }
}
正文到此结束
版权声明
本文作者菜鸟码农
文章来源菜鸟码农
原文链接 http://www.zhanghao.pro/2933.html
转载说明非特殊说明文章均为原创,页脚已标识是否允许转载,转载请注明出处!
最后修改:2021 年 09 月 14 日 04 : 29 PM