我来推广一下
我来推广一下我的公众号,前几天qnap分享的那个文章就是我写的[偷笑] 也欢迎关注我的公众号:憨憨的小木屋支持一下群友 楼主,很感谢你的教程,我现在已经部署上了,我用的是爱快路由,我虽然有域名,nginx的证书也有,端口转发出去还是http,请问这种如何加密,麻烦知道的话,也能出个后续防止爬虫和加密的教程 dksir47 发表于 2023-5-27 23:26
楼主,很感谢你的教程,我现在已经部署上了,我用的是爱快路由,我虽然有域名,nginx的证书也有,端口转发 ...
nginx反代加上ssl模块就行,爬虫的家宽不用担心,基本上不会有爬虫来,还是担心可以配置限制ua(爬虫),加密用自带的那个密码访问就可以了server {
listen 443 ssl http2;
#仅监听443端口,可以自己替换想要的端口,记得最后放行防火墙
server_name example.com;
#example.com自行换成自己的域名
ssl_certificate "/home/*.crt";
#配置ssl证书文件路径,请自行更改
ssl_certificate_key "/home/*.key";
#配置ssl私钥文件路径,请自行更改
ssl_session_cache shared:SSL:1m;
ssl_session_timeout10m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location ~ ^(/_matrix|/_synapse/client) {
# note: do not add a path (even a single /) after the port in `proxy_pass`,
# otherwise nginx will canonicalise the URI and cause signature verification
# errors.
proxy_pass http://192.168.31.11:8008;
#配置反代ip地址,请自行更改
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
# Nginx by default only allows file uploads up to 1M in size
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
client_max_body_size 50M;
# Synapse responses may be chunked, which is an HTTP/1.1 feature.
proxy_http_version 1.1;
}
} thhbdd 发表于 2023-5-28 15:36
nginx反代加上ssl模块就行,爬虫的家宽不用担心,基本上不会有爬虫来,还是担心可以配置限制ua(爬虫), ...
感谢大佬的代码,这个是在容器里运行吗?还是用shell连接?
https://imgse.com/i/p9O4ZXd https://s1.ax1x.com/2023/05/28/p9O4ZXd.png 图好像挂啦 dksir47 发表于 2023-5-28 23:18
感谢大佬的代码,这个是在容器里运行吗?还是用shell连接?
在nginx配置文件加上这段话,nginx需要你自己单独部署,或者用威联通自带的那个反向代理也可以,就在设置里面添加对应的配置就行
页:
[1]