Nginx 관리자

3617 단어 nginx개인 기록
Windows 에 Nginx tomcat 설정 개인 기록
cls
@ECHO OFF
SET NGINX_PATH=D:
SET NGINX_DIR=D:
ginx\ color 0a TITLE Nginx GOTO MENU :MENU CLS ECHO. ECHO. * * * * Nginx Management * * * * ECHO. * * ECHO. * 1 Nginx * ECHO. * * ECHO. * 2 Nginx * ECHO. * * ECHO. * 3 Nginx * ECHO. * * ECHO. * 4 * ECHO. * * ECHO. * * * * * * * * * * * * * * * * * * * * * * * * ECHO. ECHO. : set /p ID= IF "%id%"=="1" GOTO cmd1 IF "%id%"=="2" GOTO cmd2 IF "%id%"=="3" GOTO cmd3 IF "%id%"=="4" EXIT PAUSE :cmd1 ECHO. ECHO. Nginx...... IF NOT EXIST %NGINX_DIR%nginx.exe ECHO %NGINX_DIR%nginx.exe %NGINX_PATH% cd %NGINX_DIR% IF EXIST %NGINX_DIR% start %NGINX_DIR%nginx.exe ECHO.OK PAUSE GOTO MENU :cmd2 ECHO. ECHO. Nginx...... taskkill /F /IM nginx.exe > nul ECHO.OK PAUSE GOTO MENU :cmd3 ECHO. ECHO. Nginx...... taskkill /F /IM nginx.exe > nul ECHO.OK GOTO cmd1 GOTO MENU
gzip.conf
gzip              on;
gzip_min_length   1024;
gzip_buffers      4 8k;
gzip_comp_level   9;
gzip_proxied      any;
gzip_types        application/xml application/javascript application/x-javascript application/atom+xml application/rss+xml;
gzip_types        text/css text/html text/javascript text/js text/plain text/xml;
proxy.conf
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;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
nginx.conf
#Nginx      ,window    
#user  niumd niumd;
#        (    CPU    2  CPU)
worker_processes  2;
#        
#error_log  logs/error.log;
#error_log  logs/error.log  notice;
error_log  logs/error.log  info;
#  pid    
pid        logs/nginx.pid;
events {
#    IO  linux  epoll,FreeBSD    kqueue,window    。
#use epoll;
#       
worker_connections  2048;
}
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  off;
access_log  logs/access.log;
client_header_timeout  3m;
client_body_timeout    3m;
fastcgi_buffers 8 128k;
send_timeout           3m;
client_header_buffer_size    1k;
large_client_header_buffers  4 4k;
sendfile        on;
tcp_nopush      on;
tcp_nodelay     on;
#keepalive_timeout  75 20;
include    gzip.conf;
include    proxy.conf;
upstream localhost {
#  ip            tomcat,          session  ,     。
#          ,    ,ip    
#ip_hash;
#weigth      ,             
server 127.0.0.1:8080 weight=10;
}
server {
listen       80;
server_name  localhost;

    location / {
        root D:/tomcat1/webapps/ROOT/;
        index index.html index.htm index.jsp;
    }
    location ~ .*\.(html|js|css|png|gif|jpeg|jpg|apk|pda|swf|bmp)$ {
        root E:/W/workspace/1.0/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/com.cckj.smgr.server;
    }

    location ~ \.(jsp|action|do|m)$ {
        proxy_connect_timeout   3;
        proxy_send_timeout      30;
        proxy_read_timeout      30;
        proxy_pass http://localhost;
    }
    location ~ ^/(WEB-INF)/ {
        #     ,          
            deny all;
        }
}
}

좋은 웹페이지 즐겨찾기