首页 > 系统相关 >nginx文件存储

nginx文件存储

时间:2023-03-30 17:15:29浏览次数:44  
标签:文件 存储 autoindex auth nginx htpasswd user basic

yum install -y httpd-tools

 

htpasswd -cb /etc/nginx/htpasswd mynginx 123456

 

auth_basic "Please enter the user name and password"; #这里是验证时的提示信息
auth_basic_user_file /etc/nginx/htpasswd;

 

location / {
    if ($request_filename ~* ^.*?\.(txt|pdf|doc|xls)$){
    add_header Content-Disposition: 'attachment;';
}
    auth_basic "Please enter the user name and password";
    auth_basic_user_file /etc/nginx/htpasswd;
    charset utf-8,gbk;
    autoindex on;
    autoindex_exact_size off;
    autoindex_format html;
    autoindex_localtime on;
    limit_rate_after 10m;
    root /data/;
}

标签:文件,存储,autoindex,auth,nginx,htpasswd,user,basic
From: https://www.cnblogs.com/leiuk/p/17273508.html

相关文章

  • C#:Windows Forms应用程序.cs/.designer.cs/.resx文件之间关系
    在使用VisualStudio开发WindowsForms应用程序时,我们会发现每个窗体都有三个文件:.cs、.designer.cs和.resx。这三个文件之间的关系是什么呢?首先.cs文件是窗体的代码文件,其中包含了窗体的所有事件处理程序、属性和方法等。.designer.cs文件是由VisualStudio自动生成的,其中包......
  • csharp大文件上传解决方案支持分片断点上传
    ​ 4GB以上超大文件上传和断点续传服务器的实现随着视频网站和大数据应用的普及,特别是高清视频和4K视频应用的到来,超大文件上传已经成为了日常的基础应用需求。但是在......
  • asp.net webapi2.0文件上传
    [Route("api/uploadFile")]publicReturnMessagePostFile(stringsaveDirName){HttpRequesthttpRequest=HttpContext.Current......
  • Informatica 本地文件输出至FTP服务器
    点击  Mr.绵羊的知识星球 解锁更多优质文章。本文讲述的是将我本地的*.csv文件,输出到FTP服务器上infa文件夹下。前提条件:1.可用的ftp服务器,如果没有可以自行搭建。(搜索......
  • Spring配置文件和注解
    applicationContext.xml配置文件beans标签里面引入命名空间步骤:复制xmlns然后修改名称为命名空间名字xmlns:名称=“http://www.springframework.org/schema/名称”http:/......
  • Spring-Mybatis整合的所需配置文件
    Spring-Mybatis整合database.properties文件driver=com.mysql.jdbc.Driverurl=jdbc:mysql://127.0.0.1:3306/smbms?useUncode=true&characterEncoding=utf-8uname=rootpa......
  • Mybatis面向切面编程(AOP)的applicationContext配置文件
    面向切面编程(AOP)applicationContext.xml配置文件<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans" xmlns:xsi="ht......
  • spring-MVC web.xml springmvc-servlet.xml 配置文件
    springMVC配置文件web.xml<?xmlversion="1.0"encoding="UTF-8"?><web-appxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns......
  • SpringMVC整合的 spring-mvc spring-mybatis配置文件
    SpringMVC入门spring-mvc.xml配置文件<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.......
  • Spartacus 项目中 .env-cmdrc 文件的作用是什么?
    SAPSpartacus项目中.env-cmdrc文件的作用是什么?内容如下图所示:在SAPSpartacus项目中,.env-cmdrc文件用于设置环境变量。该文件是env-cmd工具的配置文件,可以通......