宝塔nginx配置允许各种文件的下载

dandan3年前程序开发5110
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|pdf|doc|docx|xls|xlsx|rar|zip|gz|7z|ppt|pptx|mp3|mp4|avi|mov|wmv)$
    {
        add_header Access-Control-Allow-Origin *;
        add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
        add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
        add_header  Access-Control-Expose-Headers 'Content-Disposition';

        
        expires      30d;
        error_log /dev/null;
        access_log /dev/null;
    }


在网站的配置文件中,修改原先类似的部分为上面的内容

相关文章

centos后台运行程序

通过远程shell工具连上服务器,运行程序后,如果关闭工具,进程也会被结束。所以采用systemctl方式运行1、创建运行用户adduser newUserName2、编辑service脚本...

通过frp+服务器+域名将本地网站映射到外网

通过frp+服务器+域名将本地网站映射到外网

因为要将台式机穿透出去,作为gpu算力使用,借助frp来实现一些接口或dify之类框架的映射,在外网访问台式机电脑。使用熟悉的老版本frp:https://github.com/fatedier/fr...

wsl2安装docker+dify+xinference

1、wsl2安装ubuntu,这里指定版本安装一个新环境 wsl --install -d Ubuntu-22.042、安装完的ubuntu是在c盘的,放到其他...

Docker使用篇

镜像:image容器:container运行镜像(如果本地有则会运行本地,本地没有会去下载镜像仓库)docker run 镜像运行镜像内系统的命令窗口(如果要退出,输入exit)d...

mac m1 docker找不到加载卷的问题

#需求是filebeat采集其他docker容器的日志,执行下面这个后,把路径/var/lib/docker/containers 给映射上,似乎就能访问到了 docker ru...

使用ngrok进行内网穿透

1、在官网注册账号:https://ngrok.com/ 2、左侧导航Setup & Installtion,下载当前电脑的应用3、左侧导航Your Authtoken,获取token配置命令...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。