frp+nginx内网穿透
背景:自己有台内网Linux主机,希望被外网访问(ssh、http、https);
准备工作
- 内网Linux主机-c,可以访问c主机和外网的主机-s(windows/linux)
- 官网下载nginx到s:https://nginx.org/en/download.html
- github上下载windows版frp到s:https://github.com/fatedier/frp/releases
- github上下载linux版frp到c:https://github.com/fatedier/frp/releases
s端配置步骤
- 配置nginx:
#443端口https请求反向代理
server {
#监听端口
listen 443 ssl;
server_name localhost;
#ssl自签证书请参考我另一篇文章 https://www.cnblogs.com/zhoux123/p/14753126.html
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
#反向代理地址
proxy_pass http://localhost:8088;
}
}
<