
很多小伙伴都有想过要搭建一个内网穿透服务,手上又正好有一台安装有宝塔的服务器,但是上面却安装了其他东西或者建了网站
要是单单想搭建一个内网穿透玩玩不可能再去买一台服务器专门搞这个吧,那就不划算了,最理想的方式就是和当前环境共存使用同一台服务器部署
很简单就一段代码即可,放在nginx/conf/目录下的proxy.conf文件内新增一下代码即可 nginx/conf/proxy.conf
需要改一下的是下面的127.0.0.1:80,把90改成你的端口,保存重启nginx

server { listen 80; server_name 5068; index index.jsp index.html index.html index.shtml index.php; location / { proxy_pass http://127.0.0.1:80; #Proxy Settings; #proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }