Armbian中Frp配合Nginx配置SSL开启HTTPS

2020-05-25 3200点热度 14人点赞 0条评论

linux环境推荐使用certbot 通过certbot --nginx命令进行一键安装let's encrypt的ssl 证书,免费加自动更新证书,一次配置,终身不用管。具体可以登录登录Certbot官网查看对应系统的安装说明。要注意是否在操作说明后面有没有这样一句话You will not need to run Certbot again, unless you change your configuration. You can test automatic renewal for your certificates by running this command。如果有说明安装完后会自动开启一个定时任务,如果没有请注意自己设置一个定时任务进行定时更新。

具体的配置如上,里面需要了解的是 Frpc客户端中 https配置有个proxy_protocol_version = v2参数和nginx配置中的listen 443 proxy_protocol ssl;这个proxy_protocol要搭配使用。这组配置主要是为了在armbian运行web时,因为使用nginx代理,导致日记中记录的都是127.0.0.1这种情况,通过把

set_real_ip_from 你的frp服务器IP; #你的frp服务器IP
#set_real_ip_from 192.168.1.2;        #不用改
set_real_ip_from 127.0.0.1;       #不用改

你所有的地址配置上后,在后台中使用$remote_addr将能够获取到来访者真实IP。

零点

这个人很懒,什么都没留下

文章评论

CAPTCHAis initialing...