[frp+nginx]实现校园网内网穿透提供http服务

/ 9,023评论 / 42217阅读 / 5点赞

注意


环境


目标效果


配置Linux服务端frps

[common]
bind_addr = 0.0.0.0              #允许客户端连接的IP;0.0.0.0表示接受所有来源
bind_port = 7000                 #frps监听端口,等待客户端来连接的端口
token = cool                     #相当于连接的密码

vhost_http_port = 10080          #服务器http服务端口

                                 #web后台管理是可以不要的
dashboard_port = 7500            #frps后台web管理端口
dashboard_user = cool            #后台管理的用户名
dashboard_pwd = coolpw           #后台管理的密码

配置Win客户端frpc

[common]
server_addr = 1.2.3.4     #服务端的机子的公网IP
server_port = 7000        #服务端的frps监听端口,需要和上面frps.ini中配置的一致
token = cool              #连接密码,需要和上面frps.ini中配置的一致

[ssh]
type = tcp                #类型
local_ip = 127.0.0.1      #要转发的端口所在的Ip
local_port = 22           #要转发的端口
remote_port = 10022       #转发到服务端的端口号

[http]
type = http               #类型
local_port = 80           #要转发的本地端口
custom_domains= *.frp.coolight.cool  #对应的域名,改成你的Linux云服务器能用的域名

配置Linux上的nginx

接下来就是要配置linux云服务器的nginx,来监听*.frp.coolight.cool的请求,并转发给Linux上的10080端口,后再由frps转发给frpc,即到达Win的80端口。

    # frp的接收http请求的反向代理
    server {
        listen 80;
        server_name *.frp.coolight.cool;        # 域名,需要改成你的

        location / {
            proxy_pass http://127.0.0.1:10080;  #你的frps监听端口
            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_set_header Upgrade $http_upgrade;
            #proxy_set_header Connection "upgrade";

            proxy_connect_timeout 7d;
            proxy_send_timeout 7d;
            proxy_read_timeout 7d;

            }


        # 防止爬虫抓取
        if ($http_user_agent ~* "360Spider|JikeSpider|Spider|spider|bot|Bot|2345Explorer|curl|wget|webZIP|qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot|NSPlayer|bingbot")
            {
                return 403;
            }
}

测试运行


配置Win的nginx

现在需要让win的nginx通过判断域名的不同,来执行不同的操作(直接返回静态资源,或者再进行转发)。


nginx详细安装配置教程

参考文章:[nginx]安装配置(ubuntu/windows)

  1. MichaelEmolf说道:

    https://mexicanpharmacy.shop/# purple pharmacy mexico price list

  2. Charlesurbam说道:

    india pharmacy: Cheapest online pharmacy – buy prescription drugs from india

  3. EdwardSkelm说道:

    buy canadian drugs Prescription Drugs from Canada best canadian pharmacy to order from

  4. EdwardSkelm说道:

    buy prescription drugs from india Generic Medicine India to USA online pharmacy india

  5. Charlesurbam说道:

    canadian pharmacy ltd: Licensed Canadian Pharmacy – canada drug pharmacy

  6. MichaelEmolf说道:

    https://canadianpharmacy24.store/# pharmacy wholesalers canada

  7. Roberterend说道:

    pharmacies in mexico that ship to usa: cheapest mexico drugs – best online pharmacies in mexico

  8. EdwardSkelm说道:

    my canadian pharmacy reviews Certified Canadian Pharmacy ordering drugs from canada

  9. EdwardSkelm说道:

    п»їlegitimate online pharmacies india indian pharmacy delivery online pharmacy india

  10. MichaelEmolf说道:

    http://indianpharmacy.icu/# buy prescription drugs from india

  11. Charlesurbam说道:

    online shopping pharmacy india: Healthcare and medicines from India – indianpharmacy com

  12. कट्टर अश्लीलता के बारे में बतावल गइल बा hjkvbasdfzxzz.TfYDJKxVPGc

  13. EdwardSkelm说道:

    pharmacy website india cheapest online pharmacy india mail order pharmacy india

  14. Roberterend说道:

    best india pharmacy: indian pharmacy delivery – reputable indian online pharmacy

  15. EdwardSkelm说道:

    best online pharmacy india Generic Medicine India to USA india pharmacy mail order

  16. Charlesurbam说道:

    medicine in mexico pharmacies: medicine in mexico pharmacies – medicine in mexico pharmacies

  17. MichaelEmolf说道:

    http://indianpharmacy.icu/# п»їlegitimate online pharmacies india

  18. समलैंगिक अश्लील qqyyooppxx.OhPXvWC4ALu

  19. Franknix说道:

    oyun siteleri slot: en iyi slot siteleri – deneme bonusu veren siteler

  20. Rodneythats说道:

    brillx скачать
    брилкс казино
    В 2023 году Brillx предлагает совершенно новые уровни азарта. Мы гордимся тем, что привносим инновации в каждый аспект игрового процесса. Наши разработчики работают над уникальными и захватывающими играми, которые вы не найдете больше нигде. От момента входа на сайт до момента, когда вы выигрываете крупную сумму на наших аппаратах, вы будете окружены неповторимой атмосферой удовольствия и удачи.Предоставив широкий спектр игр и вариантов ставок, мы делаем ставку на то, что каждый игрок найдет что-то особенное для себя. Brillx Казино – это не просто место для азартных игр, это место, где рождаются легенды и судьбы переплетаются с риском.

  21. Franknix说道:

    gates of olympus nas?l para kazanilir: gates of olympus demo oyna – gates of olympus s?rlar?

  22. WilliamDer说道:

    aviator oyunu 50 tl: aviator sinyal hilesi apk – aviator oyunu 50 tl

  23. Keithknony说道:

    http://gatesofolympus.auction/# gates of olympus oyna demo

  24. Franknix说道:

    sweet bonanza kazanma saatleri: sweet bonanza slot – sweet bonanza oyna

  25. Franknix说道:

    en guvenilir slot siteleri: slot bahis siteleri – en iyi slot siteleri 2024

  26. WilliamDer说道:

    pin up bet: pin-up bonanza – pin up giris

  27. falbobrospizzamadison Ebony porn jkkıjxxx.5MygoAwVcym

  28. Franknix说道:

    slot oyunlari: sweet bonanza free spin demo – sweet bonanza free spin demo

  29. Franknix说道:

    oyun siteleri slot: slot siteleri bonus veren – deneme veren slot siteleri

  30. WilliamDer说道:

    pin up giris: pin-up casino – aviator pin up

  31. Franknix说道:

    aviator nas?l oynan?r: aviator oyna 100 tl – aviator giris

  32. landuse Celebrity porn lancdcuse.CdTlNp1pBEZ

  33. Franknix说道:

    sweet bonanza guncel: sweet bonanza 90 tl – sweet bonanza yorumlar

  34. Keithknony说道:

    http://aviatoroyna.bid/# aviator oyna 20 tl

  35. WilliamDer说道:

    aviator oyunu giris: aviator oyunu 20 tl – aviator oyunu giris

  36. Franknix说道:

    gates of olympus oyna demo: gates of olympus demo turkce – gates of olympus guncel

  37. Franknix说道:

    aviator sinyal hilesi apk: aviator bahis – aviator hilesi ucretsiz

  38. Keithknony说道:

    http://gatesofolympus.auction/# gates of olympus hilesi

  39. Franknix说道:

    oyun siteleri slot: slot casino siteleri – deneme veren slot siteleri

  40. WilliamDer说道:

    gate of olympus hile: gates of olympus nas?l para kazanilir – gate of olympus hile

  41. jenniferroy 二穴同時挿入ポルノ japanesexxporns.2fhxpu9NfbH

  42. Franknix说道:

    2024 en iyi slot siteleri: 2024 en iyi slot siteleri – en cok kazandiran slot siteleri

  43. Franknix说道:

    gates of olympus oyna demo: gates of olympus taktik – gates of olympus oyna

  44. Keithknony说道:

    https://gatesofolympus.auction/# gates of olympus demo turkce oyna

  45. ladyandtherose Arab porn backlinkseox.JFZiHNsk2d9

  46. Franknix说道:

    aviator casino oyunu: aviator oyunu – aviator casino oyunu

  47. WilliamDer说道:

    gates of olympus nas?l para kazanilir: gates of olympus giris – gates of olympus max win

  48. goodhere Old and Young porn vurucutewet.k9oiRbhKjFM

  49. Franknix说道:

    gates of olympus 1000 demo: gate of olympus hile – gates of olympus demo turkce

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注