---
title: "nginx.conf"
author: "白云天"
date: "2016-11-26T14:12:21Z"
tags: []
categories: ["互联网"]
slug: "nginx-conf"
draft: false
lastmod: "2016-11-26T14:12:21Z"
id: 2341281
url: "https://iwin.iteye.com/blog/2341281"
---

备份记录，随便笔记

 

#######################################################################

user              nginx;  
worker\_processes  4;  
worker\_cpu\_affinity 0001 0010 0100 1000;  
 

error\_log  /var/log/nginx/error.log;

pid        /var/run/nginx.pid;

events {  
    worker\_connections  1024;  
}

#----------------------------------------------------------------------

http {  
    include       /etc/nginx/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"';

    access\_log  /var/log/nginx/access.log  main;

    sendfile        on;  
    #tcp\_nopush     on;

    keepalive\_timeout  65;

    #gzip  on;  
   
server {  
    listen       80;  
    server\_name  chint.weiwei.cn;

    location /en {  
    proxy\_pass http://192.168.0.1:8082;  
    }  
    
    location /pt {  
        proxy\_pass http://192.168.0.2:8081;  
    }

    location ~* /file-service {  
                 client\_max\_body\_size 100m;  
                 proxy\_pass http://172.19.6.133:8898;  
    }

    error\_page  404              /404.html;  
    location = /404.html {  
        root   /usr/share/nginx/html;  
    }

    error\_page   500 502 503 504  /50x.html;  
    location = /50x.html {  
        root   /usr/share/nginx/html;  
    }

}

server {  
    listen       80;  
    server\_name  ecmp.weiwei.cn;

    location / {  
        proxy\_pass http://192.168.0.1:8081;  
    }

    location ~* /file-service {  
                 client\_max\_body\_size 100m;  
                 proxy\_pass http:/192.168.0.2:8898;  
    }

    error\_page  404              /404.html;  
    location = /404.html {  
        root   /usr/share/nginx/html;  
    }

    error\_page   500 502 503 504  /50x.html;  
    location = /50x.html {  
        root   /usr/share/nginx/html;  
    }

}  
}