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

/ 9,036评论 / 42244阅读 / 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. CarlosSeill说道:

    http://mexicanpharm.online/# purple pharmacy mexico price list

  2. Robinvew说道:

    https://canadianpharm.guru/# best rated canadian pharmacy

  3. RalphRaf说道:

    reputable indian online pharmacy: indian pharmacy paypal – reputable indian online pharmacy

  4. Jamiehob说道:

    mexican border pharmacies shipping to usa: п»їbest mexican online pharmacies – mexican pharmacy

  5. RalphRaf说道:

    online pharmacy india: pharmacy website india – indian pharmacy

  6. CarlosSeill说道:

    https://pharmacynoprescription.pro/# medications online without prescription

  7. Jamesnew说道:

    cheapest online pharmacy india buy prescription drugs from india Online medicine order

  8. sklep online说道:

    This paragraph will help the internet people for creating new weblog or even a blog from start to
    end. I saw similar here: E-commerce

  9. BruceAstor说道:

    offshore pharmacy no prescription: best online pharmacy – canada pharmacy coupon

  10. This is my first time pay a visit at here and i am actually happy to read everthing at single place.
    I saw similar here: Ecommerce

  11. ShawnMug说道:

    http://edpills.guru/# online erectile dysfunction prescription

  12. BruceAstor说道:

    international pharmacy no prescription: online pharmacy delivery – canadian pharmacy no prescription needed

  13. Irvinmaype说道:

    canadian pharmacy world coupon: online pharmacy delivery – canadian pharmacies not requiring prescription

  14. Patrickjer说道:

    get ed prescription online cheapest erectile dysfunction pills online erectile dysfunction prescription

  15. ShawnMug说道:

    https://onlinepharmacy.cheap/# canadian pharmacy coupon

  16. Robertfub说道:

    http://pharmnoprescription.pro/# canadian pharmacy prescription

  17. e-commerce说道:

    Wow, fantastic weblog structure! How long have you ever been blogging for?

    you make blogging glance easy. The overall look of your site is
    magnificent, as smartly as the content material! You can see similar here sklep online

  18. ShawnMug说道:

    https://pharmnoprescription.pro/# online canadian pharmacy no prescription

  19. BruceAstor说道:

    boner pills online: ed med online – online erectile dysfunction prescription

  20. BruceAstor说道:

    cheapest pharmacy for prescription drugs: Cheapest online pharmacy – canadian pharmacy no prescription

  21. Irvinmaype说道:

    canadian online pharmacy no prescription: pharmacy online – canada drugs coupon code

  22. ShawnMug说道:

    https://pharmnoprescription.pro/# buying prescription medicine online

  23. Patrickjer说道:

    online pharmacy discount code online pharmacy delivery canadian pharmacy coupon

  24. Robertfub说道:

    http://pharmnoprescription.pro/# mail order prescriptions from canada

  25. BruceAstor说道:

    no prescription required pharmacy: mexico pharmacy online – cheapest prescription pharmacy

  26. ShawnMug说道:

    https://onlinepharmacy.cheap/# canadian pharmacy without prescription

  27. BruceAstor说道:

    get ed prescription online: cheap ed medication – online ed drugs

  28. Irvinmaype说道:

    canada pharmacy without prescription: buy prescription drugs online without – pharmacy no prescription

  29. ShawnMug说道:

    https://edpills.guru/# best ed pills online

  30. Patrickjer说道:

    online pharmacy without prescription mexico pharmacy online legit non prescription pharmacies

  31. ShawnMug说道:

    http://onlinepharmacy.cheap/# promo code for canadian pharmacy meds

  32. BruceAstor说道:

    buy erectile dysfunction pills: online ed medications – ed medicines

  33. BruceAstor说道:

    mexico online pharmacy prescription drugs: online pharmacy that does not require a prescription – online pharmacies no prescription

  34. Robertfub说道:

    http://onlinepharmacy.cheap/# online canadian pharmacy coupon

  35. ShawnMug说道:

    http://onlinepharmacy.cheap/# cheapest pharmacy to fill prescriptions with insurance

  36. Irvinmaype说道:

    top rated ed pills: ed meds by mail – best ed medication online

  37. ecommerce说道:

    Wow, awesome weblog format! How lengthy have you ever been blogging for?
    you make running a blog glance easy. The whole glance of your site is excellent,
    let alone the content material! You can see similar here sklep internetowy

  38. ShawnMug说道:

    https://edpills.guru/# where to buy erectile dysfunction pills

  39. Patrickjer说道:

    prescription drugs from canada Cheapest online pharmacy cheapest pharmacy to get prescriptions filled

  40. BruceAstor说道:

    ed medications cost: buying erectile dysfunction pills online – ed rx online

  41. ShawnMug说道:

    https://onlinepharmacy.cheap/# cheapest pharmacy for prescriptions

  42. Patrickjer说道:

    rxpharmacycoupons pharmacy online legit non prescription pharmacies

  43. Irvinmaype说道:

    buying drugs without prescription: online drugstore no prescription – meds online without prescription

  44. Robertfub说道:

    http://onlinepharmacy.cheap/# us pharmacy no prescription

  45. Zot说道:

    senkathir.net product luxury-car-lamborghini-urus-for-rent-in-dubai Our premium car rental services offer you the opportunity to rent a Lamborghini URUS in Dubai or other luxury brand cars at affordable rates. Book online or by phone and pick up your rental car or have it delivered in Dubai. With the outstanding blend of power, beauty, performance, and design, our agency provides Rent Lamborghini Urus Dubai. Simply fill out a form or give us a call to rent Urus. Lamborghini Urus is available in black, yellow, silver & blue colors. Lamborghini price in the UAE starts from 840.000 AED, but if you don’t have your own but want to drive this car undoubtedly you have a question: how much does it cost to rent a Lamborghini in Dubai? Of course, the price depends on the model, mileage, and condition of the car. So for example, Lamborghini Urus rental cost in Dubai is about 4.000 AED per day.
    https://myworldgo.com/profile/httpshelloc
    Monaco RAC can assist if you want to rent a BMW X7 M50i 2023 without breaking the bank. Our flexible options for cheap car rental Dubai include daily, weekly, and monthly plans, allowing customers to choose what fits their budget and needs. Our policies are transparent, and our service is hassle-free, catering to locals and tourists alike. Choose rental dates Experience was fine. thnks Rent for 3 days, really happy with service. Fast reply. Drop and pickup in all Dubai, nice cars with affordable rent 🥂👌🏻 A wide range of BMW models are available in Dubai at E&S Luxury Car Rental LLC, from elegant sedans to powerful sports cars and spacious SUVs, catering to all driving needs and preferences. We offer flexible rental options that make it easy to find the perfect vehicle for every occasion. With a BMW, you can explore the dynamic roads of Dubai, from the bustling city centers to the breathtaking desert landscapes, while enjoying comfort and top performance.

  46. Irwinsusia说道:

    50 mg prednisone tablet: 5mg prednisone – price of prednisone 5mg

  47. AnthonyPhave说道:

    prednisone 20mg tab price 1 mg prednisone cost 50 mg prednisone tablet

  48. BrianAcile说道:

    http://clomidst.pro/# where can i buy clomid prices

发表回复

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