锐单电子商城 , 一站式电子元器件采购平台!
  • 电话:400-990-0325

nginx配置防盗链文件服务器

时间:2023-06-25 03:07:00 t78防盗报警专用继电器

1、下载nginx-1.16.1,并编译
./configure --prefix=/data/nginx --with-http_ssl_module --with-http_v2_module --with-http_secure_link_module
默认secure_link没有编译进nginx需要添加编译选项的模块--with-http_secure_link_module
********************************nginx 防盗链****************
2、nginx 配置
server {
listen 8081;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location /image/ {
secure_link $arg_md5,$arg_expires;
secure_link_md5 "$secure_link_expires$uri$remote_addr secret";
#校验失败
if ($secure_link = "") {
return 403;
}
#防盗链时间过期<

锐单商城拥有海量元器件数据手册IC替代型号,打造电子元器件IC百科大全!

相关文章