zoukankan      html  css  js  c++  java
  • Nginx笔记总结一:基本安装和配置

    1. Nginx安装
      下载地址和安装依赖包
        http://nginx.org/download/nginx-1.9.14.tar.gz
        yum -y install pcre pcre-devel zlib-devel openssl*
      编译安装
        ./configure --prefix=/usr/local/nginx
        --with-http_ssl_module
        --with-http_stub_status_module
        --with-pcre
      启动,关闭,重启
        /usr/local/nginx/sbin/nginx 启动
        /usr/local/nginx/sbin/nginx -s stop 关闭
        /usr/local/nginx/sbin/nginx -s reload 重启
        /usr/local/nginx/sbin/nginx -t 检查配置
      配置文件
      

    user nobody;
      worker_processes 1;
      error_log logs/error.log notice;
      pid logs/nginx.pid;
      events {
        worker_connections 1024;
        use epoll;
      }
      http {
        include 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 logs/access.log main;
        sendfile on;
        tcp_nopush on;
        keepalive_timeout 0;
        gzip on;
    
    
        upstream proxy1 {
          server 192.168.89.10:180;
        }
        upstream proxy2 {
          server 192.168.89.10:280;
        }
    
    
        server {
          listen 80;
          server_name www1.dlab.com;
          location / {
            proxy_pass http://proxy1;
          }
        }
    
    
        server {
          listen 80;
          server_name www2.dlab.com;
          location / {
            proxy_pass http://proxy2;
          }
        }
      }
  • 相关阅读:
    BZOJ2741:[FOTILE模拟赛]L
    BZOJ3996:[TJOI2015]线性代数
    BZOJ3876:[AHOI2014]支线剧情
    BZOJ1861:[ZJOI2006]Book书架
    BZOJ3190:[JLOI2013]赛车
    HDU-1540 Tunnel Warfare 【线段树+单点修改+区间更新】
    HDU-1846 Brave Game 【巴什博弈】
    HDU-1421 搬寝室 【DP】
    HDU-4734 F(x) 【数位DP】
    AHU-412 Bessie Come Home 【Dijkstra】
  • 原文地址:https://www.cnblogs.com/djoker/p/6381779.html
Copyright © 2011-2022 走看看