FRP专用反代配置备份

提示:新版frp不支持win7,建议win10及以上系统。win7可以考虑下载0.49.0版尝试。

http
{
......
resolver 1.1.1.1;#添加这一行,避免出现502错误
......

## FRP专用反代配置开始

server
{
listen 80;
server_name *.xxxx.net;
location / {
proxy_pass http://$host:8080;
proxy_set_header Host $host:80;
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;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass http://$host:8080;#添加这一行
expires 30d;
}

location ~ .*\.(js|css)?$
{
proxy_pass http://$host:8080;#添加这一行
expires 12h;
}
location ~ /\.
{
deny all;
}
}

server
{
listen 80;
server_name www.xxxx.net;
location / {
proxy_pass http://$host:8080;
proxy_set_header Host $host:80;
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;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass http://$host:8080;#添加这一行
expires 30d;
}

location ~ .*\.(js|css)?$
{
proxy_pass http://$host:8080;#添加这一行
expires 12h;
}
location ~ /\.
{
deny all;
}
}

server
{
listen 80;
listen 443 ssl http2;
server_name yun.xxxxx.net;
large_client_header_buffers 4 1m;

location / {
proxy_pass http://$host:8080;
proxy_set_header Host $host:80;
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;
proxy_buffer_size 64k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
}

ssl_certificate /frps/yun.xxxx.net/fullchain.pem;
ssl_certificate_key /frps/yun.xxxx.net/privkey.pem;
ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
error_page 497 https://$host$request_uri;

#SSL-END

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
proxy_pass http://$host:8080;#添加这一行
expires 30d;
}

location ~ .*\.(js|css)?$
{
proxy_pass http://$host:8080;#添加这一行
expires 12h;
}
location ~ /\.
{
deny all;
}
}

## FRP专用反代配置结束