编程知识 cdmana.com

Example 4 of Intranet penetration based on FRP - Implementation of HTTPS access for local web services

Original address :https://wuter.cn/1932.html/

One 、 What you want to achieve

Now it has been realized that the local web The service is exposed to the public network , Now I want to realize it https visit .( Premise : There is already a corresponding certificate file , If not, apply Let's Encrypt Authority x3 This free certificate )

● How to use it frpc Implementation will be local web Service mapping to public network reference article : be based on frp An example of Intranet penetration of 2- Access to intranet deployed through a custom domain name web service

Two 、 Server configuration

1、 modify frps.ini file

[common]
bind_port = 7000
vhost_https_port = xxx
# there xxx That is, the port added after the domain name when accessing the Internet , such as www.baidu.com:80

2、 heavy load  frps.service service

systemctl restart frps

If you want to confirm whether the overload is successful , Enter the following code to verify :

systemctl status frps -l

● How to integrate frpc As a service item auto start, refer to the previous article :frp Background automatic start method

3、 ... and 、 Client configuration

1、 modify frpc.ini file

[common]
server_addr = dns.ihuster.cn # Server address or domain name
server_port = 7000
 
[ssh-web-8003to80]# Here is the first http Exposed to the public network 8003 port , With the reverse proxy implementation 80 Port access
type = tcp
local_ip = 127.0.0.1
local_port = 80
remote_port = 8003
 
[ssh-htts2http-demo]
type = https
custom_domains = frp.qimumu.top # This is your domain name
 
plugin = https2http # load https2http plug-in unit
plugin_local_addr = 127.0.0.1:80 # there 80 The port is your intranet http The actual listening port
 
# HTTPS Certificate related configuration
plugin_crt_path = ./ssl.crt # The certificate is named ssl.crt
plugin_key_path = ./ssl.key # The private key is named ssl.crt , Here, both the certificate and the private key are placed in frp Under the table of contents
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X-From-Where = frp

2、 heavy load frpc.service service

systemctl restart frpc

Four 、 test

1、http visit

2、https visit

success !

版权声明
本文为[wuter]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224214721860A.html

Scroll to Top