nginx 썸네일형 리스트형 [NGINX] nginx POST 데이터 로깅 nginx access log에 POST 데이터 로깅 로그 포맷 편접 $ vim /etc/nginx/nginx.conf ... http { # Logging Settings access_log on; log_not_found off; log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$remote_addr"'; log_format postdata '$http_x_forwarded_for - $remote_user [$time_local] "$request" ' '$status $body_bytes.. 더보기 [NGINX] nginx limit_conn | limit_req 모듈 사용하기 nginx limit_conn | limit_req 모듈 사용하기 nginx limit_conn 모듈 $ vim /etc/nginx/nginx.conf http { ... limit_conn_zone $http_x_forwarded_for zone=ddos_conn:10m; limit_conn_zone $server_name zone=rate_conn:10m; limit_conn_log_level info; limit_conn_status 571; ... } $ vim /etc/nginx/conf.d/default.conf server { listen 80; ... limit_conn ddos_conn 1; ... } nginx limit_req 모듈 $ vim /etc/nginx/nginx.conf h.. 더보기 [리눅스] HSTS(HTTP Strict Transport Security) 설정 HSTS(HTTP Strict Transport Security) 설정 Redirect HTTP connections to HTTPS Apache 설정 ServerName example.com RewriteEngine on RewriteCond %{HTTPS} !on RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L] NGINX 설정 server { listen 80; server_name example.com; return 301 https://$http_host$request_uri; } HSTS 설정 - HSTS를 사용하려면 "Strict-Transport-Security" HTTP 헤더를 설정합니다. max-age = 적용 시간. 초단위 includeSubdoma.. 더보기 [리눅스] nginx-module-vts 모듈 추가 Install Nginx Virtualhost Traffic Status module apt sourapt sources setting $ sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/mirror.kakao.com/g' /etc/apt/sources.list $ apt update APT 패키지툴을 이용하여 nginx 설치 $ apt install -yqq curl gnupg2 ca-certificates lsb-release $ echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list .. 더보기 [리눅스] nginx + tomcat(멀티 인스턴스) 설치 nginx + tomcat(멀티 인스턴스) 설치 1. nginx 설치 yum install pcre-devel zlib-devel openssl-devel mkdir /app cd /app/ tar xvfz nginx-1.10.3.tar.gz cd nginx-1.10.3 ./configure --prefix=/app/nginx --with-http_ssl_module --with-http_gzip_static_module --with-http_stub_status_module make && make install cd /app/nginx/sbin/ /app/nginx/sbin/nginx ps -ef | grep nginx $ ps -ef | grep nginx root 12446 1 0 17:33 ? 0.. 더보기 [리눅스] nginx upstream 옵션 nginx upstream 옵션 로드 밸런싱 방법(Load balancing methods) round-robin : 응용 프로그램 서버에 대한 요청은 라운드 로빈(round-robin) 방식으로 배포됩니다 least-connected : 다음 요청은 활성 연결 수가 가장 적은 서버에 할당됩니다(the least number of active connections). ip_hash : 다음 요청에 대해 어떤 서버를 선택해야 하는지 결정하는 데 해시 함수가 사용됩니다(클라이언트의 IP 주소 기반). ip_hash 동일 사용자(요청자)에 대하여 같은 업스트림 서버로 연결되도록 한다. weight=n 서버 가중치. 만약 5라면 1로 설정한 서버에 비하여 5배 더 자주 선택된다. max_fails=n 설정한 값.. 더보기 [NGINX] NGINX(nginx-1.4.2) 설치 NGINX(nginx-1.4.2) 설치 [root@lamp src]# wget http://nginx.org/download/nginx-1.4.2.tar.gz [root@lamp src]# tar xvfz nginx-1.4.2.tar.gz [root@lamp src]# cd nginx-1.4.2 [root@lamp nginx-1.4.2]# ./configure --prefix=/usr/local/nginx --user=daemon --group=daemon --with-http_ssl_module --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --wit.. 더보기 이전 1 2 3 다음