Get the App
SLTechnology News&Howtos  ›  Servers  › 

Example Analysis of Frp forced Redirection to https configuration under Nginx

Shulou Source: shulou.com Published: 2022-06-01 13:56:36 10月04日 Update

This article mainly shows you the "Nginx Frp forced redirect to https configuration example analysis", the content is easy to understand, well-organized, hope to help you solve your doubts, the following let the editor lead you to study and learn "Nginx Frp forced redirect to https configuration example analysis" this article.

Frps.ini (server configuration)

[common] bind_port = 5443kcp_bind_port = 5443vhost_http_port = 8080vhost_https_port = 444mm Frp server instruction panel configuration admin_addr = frp.test.comdashboard_port = 6443dashboard_user = testdashboard_pwd = testlog_file =. / frps.log# trace, debug, info, warn, errorlog_level = infolog_max_days = "auth token" can generate some strings token = sfsfgsdgsdgsgddgsgtcp_mux = truemax_pool_count = 5" user-defined domain name subdomain_host = frp.test.com

Frpc.ini (client configuration)

[common] # remote server IP address server_addr = 8.8.8.8server_port = 5443token = sfsfgsdgsdgsgddgsgtls_enable = true [type] type = httplocal_ip = 10.10.10.1local_port = 8 addresses where the value will eventually be resolved to lede.frp.test.com (need to do # domain name universal resolution on your domain name server to your own public network server * .frp.test.com) subdomain = ledeuse_encryption = false Use_compression = true# HTTP basic authentication can not be filled in http_user = testhttp_pwd = test

Vhosts.conf (Nginx configuration)

Server {listen 80; listen 443 ssl http2; ssl_certificate / usr/local/nginx/conf/ssl/lede.frp.test.com.crt; ssl_certificate_key / usr/local/nginx/conf/ssl/lede.frp.test.com.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers EECDHangCHACHA20 ssl http2; ssl_certificate EECDHA128RSABHAES128RSABHAES128RSABHAES256 Add_header Strict-Transport-Security max-age=15768000; ssl_stapling on; ssl_stapling_verify on; server_name lede.frp.okuka.com; access_log / data/wwwlogs/lede.frp.test.com_nginx.log combined; if ($ssl_protocol = "") {return 301 https://$host$request_uri;} location / {proxy_pass http://127.0.0.1:8080; # the port number must be the same as the vhost_http_port of frps.ini. Proxy_set_header Host $host; proxy_set_header X-Real-IP 8.8.8.8 * here fill in your public network server IP proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}} above is all the contents of this article entitled "sample analysis of Frp forced redirection to https configuration under Nginx". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Configuration services servers examples analysis enforcement content articles domain names public networks learning help consistency slogans addresses foundations characters strings domains customers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Docker Microsoft Linux Shulou Information