frp服務搭建


 

安裝命令
C
wget --no-check-certificate https://raw.githubusercontent.com/clangcn/onekey-install-shell/master/frps/install-frps.sh -O ./install-frps.sh chmod 700 ./install-frps.sh ./install-frps.sh install
卸載命令
C
./install-frps.sh uninstall
相關命令
通過這個一鍵安裝腳本安裝好frp之后,frp應該被注冊成一個服務了。所以,會有下面的一系列命令。
官方給出的相關命令是:
/etc/init.d/frps {start|stop|restart|status|config|version}
而frps是個系統命令了,所以路徑也大可不必寫了。
frps {start|stop|restart|status|config|version}
 
我的服務器配置:
客戶端配置:
[common]
server_addr = 46.08.7.1
server_port = 8080
token =token123
tcp_mux = true
 
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 5000
 
[web]
type = http
local_port = 8080
custom_domains = abc.frp.shm.top
 
 
# [RemoteDesktop]
#type = tcp
#local_port = 3389 #內網機器遠程桌面端口
#remote_port = 6000 #內網機器提供外網遠程桌面鏈接的端口
 
如果客戶端無法訪問,看看阿里雲安全組對應端口是否放開!!!!
 
nginx 配置:
配置nginx反向代理,將來自80端口並指向*.frp.lestat.me的請求分發至frp服務器http請求的監聽端口
server {
    listen       80;
    server_name *.frp.yanquanguoke.top;

    location / {
        proxy_pass  http://127.0.0.1:8080;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_max_temp_file_size 0;
        proxy_redirect off;
        proxy_read_timeout 240s;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM