user  nginx;
worker_processes 8; # = cpu num; error_log /data/nginx/log/error/error.log warn; # warn, error crit, alert, and emerg levels are logged. NGINX Docs | Configuring Logging https://docs.nginx.com/nginx/admin-guide/monitoring/logging/ #pid logs/nginx.pid; events {
worker_connections 10240;
multi_accept on;
use epoll;
} http {
# log NGINX Docs | Configuring Logging https://docs.nginx.com/nginx/admin-guide/monitoring/logging/
log_format compression '$http_host - $remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';
gzip on;
access_log /data/nginx/log/access/nginx-access.log compression; include mime.types;
default_type application/octet-stream; server_tokens off;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 10;
client_header_timeout 10;
client_body_timeout 10;
reset_timedout_connection on;
send_timeout 10;
limit_conn_zone $binary_remote_addr zone=addr:5m;
limit_conn addr 100;
charset UTF-8; open_file_cache max=100000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
client_max_body_size 151M; server {
listen 80;
location ~ ^/visit/index?.+$ {
proxy_pass http://1.2.19.19:18080;
access_log /data/nginx/log/access/nginx-access-proxy_pass.log compression;
}
}
# 分发请求的2种方式:1、指明server_name;2、通过location过滤uri来分发请求;
server {
listen 80;
server_name localhost; #charset koi8-r;
#access_log logs/host.access.log main; root /var/www/statistics_20170105/public; location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?$1 last;
}
} #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 {
root html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; }
}
server {
listen 80;
server_name per.go-old.com; #charset koi8-r;
#access_log logs/host.access.log main; root /var/www/opcenter/public; location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?$1 last;
}
} #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 {
root html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; }
}
server {
listen 80;
server_name yzt.go-old.com pay.go-old.com xmt.go-old.com; #charset koi8-r;
#access_log logs/host.access.log main; root /var/www/yzt/public; location / {
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^/(.*) /index.php?$1 last;
}
} #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 {
root html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; }
}
}

  

nginx分发请求的2种方式:1、指明server_name;2、通过location过滤uri来分发请求;的更多相关文章

  1. Zabbix监控nginx性能的另外一种方式

    Zabbix监控nginx性能的另外一种方式 nginx和php-fpm一样内建了一个状态页,对于想了解nginx的状态以及监控nginx非常有用,为了后续的zabbix监控,我们需要先启用nginx ...

  2. 第二节:SSL证书的申请、配置(IIS通用)及跳转Https请求的两种方式

    一. 相关概念介绍 1. SSL证书服务 SSL证书服务由"服务商"联合多家国内外数字证书管理和颁发的权威机构.在xx云平台上直接提供的服务器数字证书.您可以在阿里云.腾讯云等平台 ...

  3. C#中Post请求的两种方式发送参数链和Body的

    POST请求 有两种方式 一种是组装key=value这种参数对的方式 一种是直接把一个字符串发送过去 作为body的方式 我们在postman中可以看到 sfdsafd sdfsdfds publi ...

  4. Spring MVC中forward请求转发2种方式(带参数)

    Spring MVC中forward请求转发2种方式(带参数) http://www.51gjie.com/javaweb/956.html  

  5. 解决 SharePoint 2010 拒绝访问爬网内容源错误的小技巧(禁用环回请求的两种方式)

    这里有一条解决在SharePoint 2010搜索爬网时遇到的“拒绝访问错误”的小技巧. 首先要检查默认内容访问帐户是否具有相应的访问权限,或者添加一条相应的爬网规则.如果目标资源库是一个ShareP ...

  6. nginx负载均衡(5种方式)、rewrite重写规则及多server反代配置梳理

    Nginx除了可以用作web服务器外,他还可以用来做高性能的反向代理服务器,它能提供稳定高效的负载均衡解决方案.nginx可以用轮询.IP哈希.URL哈希等方式调度后端服务器,同时也能提供健康检查功能 ...

  7. (转)nginx负载均衡(5种方式)、rewrite重写规则及多server反代配置梳理

    Nginx除了可以用作web服务器外,他还可以用来做高性能的反向代理服务器,它能提供稳定高效的负载均衡解决方案.nginx可以用轮询.IP哈希.URL哈希等方式调度后端服务器,同时也能提供健康检查功能 ...

  8. nginx负载均衡的五种方式

    文章目录 前言 :负载均衡是什么 一.方式1:轮询 二.方式2:权重 方式3:iphash 方式4:最小连接 方式5:fair 总结:根据这几种方式可以猜测处nginx的底层使用了计数器,从而可以将海 ...

  9. WebAPI GET和POST请求的几种方式

    GET请求 1.无参数get请求 一般get请求有两种写法,一种是$.get()   一种是$.ajax({type:"get"}),我个人比较喜欢用后者. 下面例子主要是get无 ...

随机推荐

  1. html中iframe子页面与父页面元素的访问以及js变量的访问

    1.子页面访问父页面元素   parent.document.getElementById('id')和document相关的方法都可以这样用   2.父页面访问子页面元素   document.ge ...

  2. 如何使用微信JS-SDK实际分享功能

    http://jingyan.baidu.com/album/d3b74d64c517051f77e609ed.html?picindex=7

  3. WWDC 2014 Session笔记 - iOS界面开发的大一统

    本文是我的 WWDC 2014 笔记 中的一篇,涉及的 Session 有 What's New in Cocoa Touch Building Adaptive Apps with UIKit Wh ...

  4. 实现在edittext中任意插入图片

    Myedittext: public class MyEditText extends EditText { public MyEditText(Context context) { super(co ...

  5. php代码检查

    最近写php,几个同事都是没写过c的,经常写的变量没有定义,而php没有编译,错误无法发现. 我们现在用的是NetBeans,好在其提供了语法检测,如下图,让编辑器强制显示我错误

  6. alsamixer 在音频子系统的使用

    alsamixer是Linux 音频架构ALSA工具的其中一个,用于配置音频的各个参数. alsamixer是基于文本下的图形界面的,可以通过键盘的上下键,左右键等,很方便地设置需要的音量,开关某个s ...

  7. xeno 实时性能测试 在100us的采样周期的测试数据

    1 xeno 用户层测试时间: root@sama5d3-linux:/usr/bin latency -t0 -T25 -p100== Sampling period: 100 us== Test ...

  8. 清除Css中select的下拉箭头样式

    select {/*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/border: solid 1px #000; /*很关键:将默认的select选择框样式清除*/appeara ...

  9. 更新加子查询加相同的表解决办法 mysql

    UPDATE ofuser SET auid = '0' WHERE uid in (SELECT uid FROM (select tmp.* from ofuser tmp)a WHERE aui ...

  10. 【cf492】D. Vanya and Computer Game(二分)

    http://codeforces.com/contest/492/problem/D 有时候感觉人sb还是sb,为什么题目都看不清楚? x per second, y per second... 于 ...