nginx 配置文件下载及在线浏览
发表于:2025-12-03 作者:千家信息网编辑
千家信息网最后更新 2025年12月03日,nginx 配置文件下载及在线浏览1.主配置文件# vim nginx.confuser nginx;worker_processes 2;worker_rlimit_nofile 65535;e
千家信息网最后更新 2025年12月03日nginx 配置文件下载及在线浏览
nginx 配置文件下载及在线浏览
1.主配置文件
# vim nginx.confuser nginx;worker_processes 2;worker_rlimit_nofile 65535;error_log /usr/local/nginx/logs/error.log warn;pid /usr/local/nginx/logs/nginx.pid;events { use epoll; worker_connections 4096; multi_accept on;}http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; client_header_timeout 20; client_body_timeout 20; send_timeout 30; gzip on; gzip_min_length 1k; gzip_buffers 4 16k; gzip_http_version 1.0; gzip_comp_level 4; gzip_types text/plain application/x-javascript text/css application/xml; gzip_vary on; include fastcgi_params; include /usr/local/nginx/conf/vhosts/*.conf;}2.下载配置文件
# vim toms-file.conf server { listen 80; server_name 10.1.1.222; access_log /data/logs/file_seedeer.log main; index index.html index.htm index.php; root /pdf_data/pdf; access_log_bypass_if ($remote_addr ~* '^100.97') and; access_log_bypass_if ($request ~* "HEAD / HTTP/1.0"); access_log /usr/local/nginx/logs/api_toms.log; charset utf-8; location / { autoindex on; autoindex_exact_size on; autoindex_localtime on; if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){ add_header Content-Disposition: 'p_w_upload;'; } } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|mp3)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 30d; }}3.说明
location / { autoindex on; autoindex_exact_size on; autoindex_localtime on; if ($request_filename ~* ^.*?\.(txt|doc|pdf|rar|gz|zip|docx|exe|xlsx|ppt|pptx)$){ add_header Content-Disposition: 'p_w_upload;'; } }以上配置允许的文件格式后缀,文件可以打开,可以下载。
charset utf-8; //支持的字符集,不然汉字会乱码
4.测试文件预览及下载

文件
配置
文件下载
在线
浏览
乱码
后缀
字符
字符集
格式
汉字
支持
测试
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网金融科技包括
保 数据库安全性
河北pdu服务器电源需要多少钱
服务器有声卡
软件开发有哪些协议
内蒙古网络技术公司招聘
杭州宏力网络技术有限公司
谷歌服务器通信请稍后重试
贵州时代网络技术分类产品介绍
文山计算机网络技术费用
台州数据库培训学校
单片机分离数据库
软件开发经理岗位职责怎么写
怎么解除服务器的安全连接
数据库安装后如何还原数据库
php的数据库页面
安徽网络技术咨询价值
网络安全poc验证
怎么选服务器ups
数据库调用最新5条
软件开发公司有什么资质
hpe机架式服务器厂家
数据库实用教程中国电力课后习题
ios软件开发收益渠道
武汉恒垒空间网络技术有限公司
网络安全二八原则
公司网络安全计划
圆通子系统怎样清理数据库
网络安全科研课题组
怎么选服务器ups