nginx 文件服务器配置,模板配置文件,有注释
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/ user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf; events {
worker_connections 1024;
} http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
autoindex on; # 显示目录
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间 include /etc/nginx/mime.types;
default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf; #反响代理server 配置,可用于负载均衡
upstream file {
least_conn;
server 192.168.5.222;
} server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html; # Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf; location / {
#proxy_pass http://192.168.5.222;
} error_page 404 /nginx/404.html;
location = /nginx/40x.html {
} error_page 500 502 503 504 /nginx/50x.html;
location = /nginx/50x.html {
}
}
# 反向代理server
server {
listen 9999;
server_name _;
location / {
proxy_pass http://file;
}
} # Settings for a TLS enabled server.
#
# server {
# listen 443 ssl http2 default_server;
# listen [::]:443 ssl http2 default_server;
# server_name _;
# root /usr/share/nginx/html;
#
# ssl_certificate "/etc/pki/nginx/server.crt";
# ssl_certificate_key "/etc/pki/nginx/private/server.key";
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 10m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
#
# # Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
#
# location / {
# }
#
# error_page 404 /404.html;
# location = /40x.html {
# }
#
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
# } }
重点在于配置如下选项:
autoindex on; # 显示目录
autoindex_exact_size on; # 显示文件大小
autoindex_localtime on; # 显示文件时间
参考链接:
https://www.cnblogs.com/andyfengzp/p/6434125.html
https://blog.csdn.net/datadev_sh/article/details/83819791
nginx 文件服务器配置,模板配置文件,有注释的更多相关文章
- MacOS查看NGINX文件路径(配置文件、日志文件)
使用 MacOS 经常发现 NGINX 路径不好找,后来发现一个很好的命令来查找: nginx -V 即可输出 NGINX 各文件夹的路径.
- Nginx HTTP服务器配置模板
https://github.com/h5bp/server-configs-nginx
- 中文注释 MariaDB my.cnf 大型服务器配置模板
文件如下所示,请根据需要进行修改: 翻译日期: 2014年5月22日 翻译人员: 铁锚 # /usr/share/mysql/my-huge.cnf # MariaDB 配置文件 示例模板(huge, ...
- Linux centosVMware 自动化运维Ansible介绍、Ansible安装、远程执行命令、拷贝文件或者目录、远程执行脚本、管理任务计划、安装rpm包/管理服务、 playbook的使用、 playbook中的循环、 playbook中的条件判断、 playbook中的handlers、playbook实战-nginx安装、管理配置文件
一.Ansible介绍 不需要安装客户端,通过sshd去通信 基于模块工作,模块可以由任何语言开发 不仅支持命令行使用模块,也支持编写yaml格式的playbook,易于编写和阅读 安装十分简单,ce ...
- 通过python生成nginx模板配置文件
通过python生成nginx模板配置文件 # cat config.py #coding=utf-8 nginx_conf = ''' server {{ listen {port}; server ...
- caffe-windows之网络描述文件和参数配置文件注释(mnist例程)
caffe-windows之网络描述文件和参数配置文件注释(mnist例程) lenet_solver.prototxt:在训练和测试时涉及到一些参数配置,训练超参数文件 <-----lenet ...
- VS模板文件修改,自动生成注释
VS的模板文件存放在IDE下的ItemTemplatesCache文件夹下 1.不同VS版本IDE文件夹路径个有不同,下面以VS2012为例,IDE文件夹路径如图:
- 整理 PHPstorm实用个人配置,修改调整个性化快捷键,修改使用phpstorm创建的模板的默认注释:
对你有助请点赞,请顶------送人玫瑰,手留余香! 1:58 2016/3/12 整理PHPstorm实用个人配置,修改调整个性化快捷键,修改使用phpstorm创建的模板的默认注释: PHPsto ...
- CI 资源文件加入模板
CI 资源文件加入模板: (资源文件:图片,css,js ,业务文件csv,txt.....) 1.引入url辅助函数库 helper 2.使用base_url函数 生成文件物理硬盘地址 3. ...
随机推荐
- JavaScript动态加载script方式引用百度地图API,Uncaught ReferenceError: BMap is not defined
百度地图官网文档介绍使用JSSDK时,仅提供了2种引入方式: script引入 异步加载 实际工作场景中仅某一两个页面或者只是单纯有功能需要用到百度地图,所以没有必要在 index.html 中全局引 ...
- R语言入门1:安装R和RStudio
R语言入门1:安装R和RStudio 曹务强 中科院遗传学博士研究生 9 人赞同了该文章 1. Windows安装R 在Windows系统上,安装R语言比较简单,直接从R的官方网站下载,按照正常的软件 ...
- https连接
在发送连接之前设置显示握手过程: System.setProperty("javax.net.debug", "all"); DubboServer ...
- QT--HTTP图片下载器
QT--HTTP图片下载器 1.http使用前提 QT += core gui network //必须加上network 2.必须头文件 #include <QNetwork ...
- 039.[转] 基于 Kubernetes 和 Spring Cloud 的微服务化实践
http://dockone.io/article/2967 基于 Kubernetes 和 Spring Cloud 的微服务化实践 写在前面 网易云容器平台期望能给实施了微服务架构的团队提供完整的 ...
- SQL Server存储过程备份数据库的脚本-干货
拿AAAAAAAA数据库为例子,除了汉字标注的替换真实的数据,其他都不动 CREATE proc [dbo].[p_log_backupAAAAAAAA] @dbname sysn ...
- div里面的元素垂直均匀分布 按钮引发地址栏出现问号 判断一个数组是否为空 div底部居中 路由传参接受参数
一个固定高度的div的子元素 在垂直 方向上平均分布 .important-dec{ height: 121px; flex-direction: column; display: flex; jus ...
- C++ 虚函数的说明
虚函数的几点说明: 1. 当一个成员函数定义为虚函数时,其派生类中的同名函数也自动为虚函数.无论其是否添加了 virtual 关键字. 为了能良好的阅读代码,请加上. 2. 父类的虚函数,就是为了让子 ...
- LG4158 「SCOI2009」粉刷匠 线性DP
问题描述 LG4158 题解 设\(opt[i][j][k]\)代表到\((i,k)\)刷了\(j\)次的方案数. 一开始DP顺序有点问题,调了很长时间. 务必考虑清楚DP顺序问题 \(\mathrm ...
- ubuntu升级pip报cannot import name 'main'解决方法
执行sudo vi /usr/bin/pip 将代码: from pip import main if __name__ == '__main__': sys.exit(main()) 修改为: fr ...