Ubuntu 14.04.1 Nginx 역방향 에이전트

sudo apt-get install ntp
server 1.cn.pool.ntp.org
server 1.asia.pool.ntp.org
server 0.asia.pool.ntp.org
groupadd nginx
useradd -M -s /sbin/nologin nginx -g nginx
sudo apt-get install gcc g++ make automake
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
./configure  \
--prefix=/usr/local/nginx \  
--with-http_stub_status_module    #NGINX 상태 조회 지원
--with-http_spdy_module              #GOOGLE 의 SPDY 를 지지 합 니 다.
--with-http_ssl_module                 #HTTPS 지원
 --with-http_gzip_static_module   ##사전 압축 파일 전송 전 검사, 파일 중복 압축 방지
--with-pcre                                     #rewrite 재 작성 기능 지원
--user=nginx \
--group=nginx \
--http-log-path=/var/log/nginx/access.log \
--error-log-path=/var/log/nginx/error.log \
make && make install
server{
    listen 80;
    server_name ~^(.+)?\.supuy\.com$;
    access_log /var/log/nginx/xxx.xxx.xxx_access.log combined;
    location / {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://xxx.xxx.xxx.xxx;
    }
    location ~* \.(tgz|rar|bz2|zip|7z|tar|gz|bz|Z|)$
    {
        root html;
        return 404;
    }
}
  nginx.conf 
  
worker_rlimit_nofile 65535;
  /etc/security/limits.conf
  
* soft nofile  655360
* hard nofile 655360
fs.file-max=65535
net.ipv4.tcp_syncookies = 1 
#
net.ipv4.tcp_fin_timeout = 30 
#
net.ipv4.tcp_tw_reuse = 1
#
net.ipv4.tcp_tw_recycle = 1
#
net.ipv4.ip_local_port_range = 1024 65000
#
net.ipv4.tcp_max_syn_backlog = 65536 
#
net.ipv4.tcp_max_tw_buckets = 6000
#
net.ipv4.route.gc_timeout = 100
net.ipv4.tcp_syn_retries = 1
#
net.ipv4.tcp_synack_retries = 1

net.core.somaxconn = 65535 
#
net.core.netdev_max_backlog = 262144
#
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_max_orphans = 262144
#

좋은 웹페이지 즐겨찾기