nginx 프로필 및 일반 모듈

5392 단어 nginx
  • nginx 설치 디 렉 터 리
  • nginx 변수
  • nginx 모듈
  • http - auth 모듈




  • nginx 설치 디 렉 터 리
    # Nginx    ,   logrotate       
    /etc/logrotate.d/nginx
    
    # Nginx     
    /etc/nginx
    /etc/nginx/nginx.conf
    /etc/nginx/conf.d
    /etc/nginx/conf.d/default.conf
    
    # cgi    ,fastcgi  
    /etc/nginx/fastcgi_params
    /etc/nginx/scgi_params
    /etc/nginx/uwsgi_params
    
    #           
    /etc/nginx/koi-utf
    /etc/nginx/koi-win
    /etc/nginx/win-utf
    
    #   http   Content-Type        
    /etc/nginx/mime.types
    
    #                   
    /etc/sysconfig/nginx
    /etc/sysconfig/nginx-debug
    /usr/lib/systemd/system/nginx-debug.service
    /usr/lib/systemd/system/nginx.service
    
    # Nginx     
    /etc/nginx/modules
    /usr/lib64/nginx/modules
    
    # Nginx           
    /usr/sbin/nginx
    /usr/sbin/nginx-debug
    
    # Nginx        
    /usr/share/doc/nginx-1.12.2
    /usr/share/doc/nginx-1.12.2/COPYRIGHT
    /usr/share/man/man8/nginx.8.gz
    
    # Nginx     
    /var/cache/nginx
    
    # Nginx     
    /var/log/nginx

    nginx 변수
    HTTP$http_user_agent$http_cookie   HTTP       。
        :
    $args,       ;
    $content_length, HTTP      "Content-Length";
    $content_type,       "Content-Type";
    $document_root,              ;
    $document_uri,  $uri  ;
    $host,       "Host"Host ,          ;
    $limit_rate,         ;
    $request_method,      ,  "GET""POST" ;
    $remote_addr,      ;
    $remote_port,       ;
    $remote_user,       ,   ;
    $request_filename,           
    $request_body_file, ??
    $request_uri,    URI,   ;
    $query_string,  $args  ;
    $scheme,      ,  http   https,  rewrite  ^(.+)$  $scheme://example.com$1  redirect;
    $server_protocol,        ,"HTTP/1.0" "HTTP/1.1";
    $server_addr,      ,     listen       ,                    (      );
    $server_name,          ;
    $server_port,            ;
    $uri,    URI,          ,          。

    nginx 모듈
    nginx 공식 중국어 - 모듈
    http - auth 모듈
  • linux 조작
  • #  htpasswd  
    yum install httpd
    
    #      
    cd /etc/nginx
    #  auth_conf  ,   jehad
    htpasswd -c ./auth_conf jehad
    #          ,      
    htpasswd ./auth_conf jhcoder
  • 다음은 nginx 설정
  • server {
        listen 80;
        server_name localhost;
    
        location / {
          root  /usr/share/nginx/html;
          index index.html;
        }
    
        #  admin       ip  (      )     remote_addr,          ,  frp   
    #    location ~ ^/admin.html {
    #      root /home/project/nginx-code;
    #      deny all;
    #      allow 113.87.88.143;
    #    }
    
        location ~ ^/admin.html {
          root /home/project/nginx-code;
          auth_basic  ".......     .........";
          auth_basic_user_file  /etc/nginx/auth_conf;
        }
    
    
    }
  • 모듈 의 한계 성 1、 2、
  • 해결 방법 1、nginx+lua 2、nginx+ladp nginx-auth-ladp
  • 좋은 웹페이지 즐겨찾기