nginx配置文件详解【nginx.conf】
#基本配置:
#user nobody;#配置worker进程运行用户
worker_processes 1;#配置工作进程数目,根据硬件调整、通常等于CPU数量或者2倍于CPU数量 比如四核电脑(可以配置4或者8)
#error_log logs/error.log; #配置日志类型、默认为error级别
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;#配置进程pid文件 【进程编号】
#事件配置:
events {
worker_connections 1024; #配置worker进程连接数量上线,nginx链接的总数等于worker_connections*worker_processes 的值
}
#配置http服务器,利用他的反向代理功能提供负载均衡支持
http {
#http基本配置
include mime.types;#配置nginx支持哪些多媒体类型
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"';
#配置access.log日志及存放路径、并使用上面定义的main日志格式
#access_log logs/access.log main;
sendfile on;#开启高效文件传输模式
#tcp_nopush on;#防止网络阻塞
#keepalive_timeout 0;
keepalive_timeout 65;#长连接超时时间
#gzip on;#开启gzip压缩输出
#多个server配置
server {
listen 8089;
server_name localhost;
location /{#web项目代理地址
proxy_pass http://localhost:8080/;
}
}
server {
listen 8088;
server_name localhost;
#charset koi8-r;
location /ecustom/workflow/form/js {
root D:/OADev/Workspace/ecology-innovation/WebContent;
}
location /{
proxy_pass http://172.16.0.80:8443;
}
#配置404页面
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {#配置50开头的错误页面
root html;
}
#php脚本请求全部转发到Apache处理
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
#php脚本请求全部转发到FastCGI处理
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
#禁止访问.htaccess文件
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;#拒接所有文件
#}
}
#配置另一个虚拟机主机
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;#配置监听端口
# listen somename:8080;
# server_name somename alias another.alias;#配置服务名
#默认的斜杠请求,匹配所有请求
# location / {
# root html;#配置服务器默认网站根目录位置,默认为ngnix安装
# index index.html index.htm;#配置首页文件的名称
# }
#}
#配置https服务 ---运维工作
# HTTPS server
#
#server {
# listen 443 ssl;#默认端口
# server_name localhost;
# ssl_certificate cert.pem;#证书
# ssl_certificate_key cert.key;#密钥
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
nginx配置文件详解【nginx.conf】的更多相关文章
- nginx之旅(第一篇):nginx下载安装、nginx启动与关闭、nginx配置文件详解、nginx默认网站
一.nginx下载安装 版本nginx 1.15.5 系统环境centos7.5(本机ip192.168.199.228) 关闭selinux 和防火墙firewall 1.下载 wget http: ...
- 一、Nginx配置文件详解
配置文件介绍 主要有两部分:分别是 main:主体部分 http{}:虚拟主机配置部分 配置指令主要以分号结尾:配置语法:directive value1 [value2 ....] 支持使用的变量 ...
- Nginx系列(10)- Nginx配置文件详解
nginx文件结构 ... #全局块 events { #events块 ... } http #http块 { ... #http全局块 server #server块 { ... #server全 ...
- nginx配置文件详解(三)
nginx配置文件详细解析 nginx安装目录: /usr/local/nginx 配置文件: /usr/local/nginx/conf 目录下的 nginx.conf文件 nginx优化方法1 ...
- Nginx配置文件详解
Nginx是一款面向性能设计的HTTP服务器,相较于Apache.lighttpd具有占有内存少,稳定性高等优势. ######Nginx配置文件nginx.conf中文详解##### #定义Ngin ...
- Nginx教程(五) Nginx配置文件详解
一. Nginx配置文件nginx.conf中文详解 #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_processe ...
- Nginx教程(五) Nginx配置文件详解 (转)
一. Nginx配置文件nginx.conf中文详解 #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_processe ...
- Nginx:Nginx配置文件详解
Nginx是一款面向性能设计的HTTP服务器,相较于Apache.lighttpd具有占有内存少,稳定性高等优势. 如下是Nginx的配置详解: ######Nginx配置文件nginx.conf中文 ...
- Nginx配置文件详解与优化建议
1.概述 今天来详解一下Nginx的配置文件,以及给出一些配置建议,希望能对大家有所帮助. 2.nginx.conf 1)配置文件位置 nginx 安装目录的 conf 文件夹下,例如:/usr/lo ...
- nginx实现动静分离--附nginx配置文件详解
转自http://www.cnblogs.com/1214804270hacker/p/9299462.html 一.认识访问静态资源与访问动态资源的区别 静态资源:指存储在硬盘内的数据,固定的数据, ...
随机推荐
- 通过pathinfo返回扩展名
strtolower(pathinfo(abs.php,PATHINFO_EXTENSION)); 小写 通过pathinfo返回扩展名 pathinfo() 函数以数组的形式返回文件路径的信息. p ...
- jquery weui 图片浏览器Photo Browser
jquery weui 图片浏览器Photo Browser 如何使用? 对应组件地址:http://jqweui.com/extends#swiper 先说说业务场景:类似朋友圈这样的布局效果,点击 ...
- 【CSS3练习】在圆上旋转的菜单
先上效果图:就是用js计算每个小圆的位置分布到大圆的边线上,然后在让大圆旋转起来. 线上查看地址:http://dtdxrk.github.io/game/css3-demo/diffuse.html ...
- ajax页面刷新小错误(提交按钮type必须为button,而不能是submit)
背景: 使用ajax提交form表单时,提交按钮的type值写为了submit,导致ajax中回调函数中的提示信息toastr.success('提交数据成功');没有执行,只执行了alert语句 , ...
- jvm(3)---常用监控工具指令
1.jps 查看jvm中运行的进程(获取对应pid) 参数:默认-V(大写) -v: 列出jvm启动参数. ---------------------------------- 2.jstack pi ...
- 安装Windows和Ubuntu双系统
发现关注消息 安装Windows和Ubuntu双系统 安装Windows和Ubuntu双系统 0.552016.12.10 15:54:41字数 2101阅读 6644 这几天开始动手做毕设啦 ...
- social engineering toolkit
1. freebuf介绍 http://www.freebuf.com/sectool/73409.html 2. github https://github.com/trustedsec/socia ...
- vmware linux 硬盘空间不足时增加硬盘并挂载
不同的版本的vmware在设置界面中可能稍有不同,基本是一致的. 还有一种方式是扩展,这里没有记录,扩展时需要在虚拟机关机状态下. 1.选择在vmware中点击设置并打开,将光标定位在hard Dis ...
- SpringBoot部署到Linux上AppserverApplication,访问不到控制层
放在本地是好好的,可以请求到,放到Linux上去的话就直接404, 解决办法: SpringBoot有个加载类叫AppserverApplication.这个大家应该都知道,我们平常都是如下写: @S ...
- pytorch1.0批训练神经网络
pytorch1.0批训练神经网络 import torch import torch.utils.data as Data # Torch 中提供了一种帮助整理数据结构的工具, 叫做 DataLoa ...