frp反向代理

1,073次阅读
没有评论

# 服务器端管理后台
server {
listen 80;
server_name frp.123.net;

location / {
proxy_pass http://127.0.0.1:6443;
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;
}
}

# 代理 http web
server {
listen 80;
server_name *.frp.123.net;

location / {
proxy_pass http://127.0.0.1:81;
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;
}
}

# 如果启用 SSL
server {
listen 443 ssl;
server_name *.frp.123.net;

#SSL-START SSL 相关配置,请勿删除或修改下一行带注释的 404 规则
#error_page 404/404.html;
ssl_certificate /etc/letsencrypt/live/ftp.123.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ftp.123.net/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
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 60m;
error_page 497 https://$host$request_uri;

#SSL-END

location / {
proxy_pass http://127.0.0.1:81;
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;
}
}

正文完
 0
评论(没有评论)
验证码