nginx 썸네일형 리스트형 CentOS 7에서 NGINX의 최신 버전을 설치하는 방법 CentOS 7에서 NGINX의 최신 버전(안정 버전)을 설치하는 방법nginx : High performance web server RHEL and derivatives : http://nginx.org/en/linux_packages.html#RHEL-CentOS테스트 환경운영체제 버전 정보$ cat /etc/os-release | grep PRETTY_NAME | cut -d '"' -f 2CentOS Linux 7 (Core)NGINX 설치EPEL 저장소 및 YUM Utilities 패키지 설치yum install -y epel-release yum-utilsnginx.repo 파일 생성sudo tee /etc/yum.repos.d/nginx.repo 더보기---nginx.repo 파일 확인cat.. 더보기 RPS(Requests Per Second) RPS(Requests Per Second) - 초당 요청 수Request Per Second(RPS)는 서버가 1초 동안 처리한 HTTP 요청의 개수를 의미하는 지표입니다. 이는 웹 서버, API 서버 등의 처리 성능을 측정하고 트래픽 부하를 평가하는 데 매우 유용한 지표입니다.정의RPS = 특정 시간 동안의 총 요청 수 ÷ 초 단위 시간예를 들어, 1초 동안 1,000개의 요청을 처리했다면 해당 서버의 RPS는 1,000입니다.이는 해당 웹 서버가 초당 1,000건의 요청을 처리할 수 있는 처리 능력을 가지고 있음을 의미합니다.RPS가 중요한 이유서비스의 성능 모니터링 및 병목 구간 파악부하 분산, 스케일 업/아웃 기준 설정서버 리소스의 최적화 지표실시간 트래픽 변화 감지 및 대응RPS 분석(NGIN.. 더보기 Nginx의 액세스 로그에서 공격자 IP(attacker ip) 주소를 추출하는 방법 Nginx의 액세스 로그에서 공격자 IP(attacker ip) 주소를 추출하는 방법 tail -n 10000 access.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 10 $ tail -n 10000 /var/log/nginx/access.log | awk '{print $1}' | sort | uniq -c | sort -nr | head -n 10 554 111.111.111.111 210 222.222.222.222 57 222.222.222.223 56 222.222.222.224 50 222.222.222.225 48 222.222.222.226 48 222.222.222.227 45 222.222.222.228 44 222.22.. 더보기 취약점을 방지하기 위한 보안 HTTP 헤더를 설정하기 취약점을 방지하기 위한 보안 HTTP 헤더를 설정하기X-Content-Type-Options###ApacheHeader set X-Content-Type-Options nosniff###Nginxadd_header X-Content-Type-Options nosniff;X-XSS-Protection###ApacheHeader set X-XSS-Protection "1; mode=block"###Nginxadd_header X-XSS-Protection "1; mode=block";X-Frame-Options###ApacheHeader always append X-Frame-Options DENY###Nginxadd_header X-Frame-Options “DENY”;HTTP Strict Transpor.. 더보기 NGING에서 PHP-FPM 상태를 활성화하고 모니터링하는 방법 NGING에서 PHP-FPM 상태를 활성화하고 모니터링하는 방법nginx 설정vim /etc/nginx/conf.d/default.conf$ vim /etc/nginx/conf.d/default.conf... # nginx, php-fpm status location ~ ^/(status|ping)$ { fastcgi_pass unix:/run/php-fpm/php-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; allow 127.0.0.1; al.. 더보기 NGINX 및 PHP-FPM Access Log 포맷 설정 NGINX 및 PHP-FPM Access Log 포맷 설정nginx access log format 설정vim /etc/nginx/nginx.confhttp {... log_format main '$http_x_forwarded_for - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$remote_addr"' ' REQ_TIME: $request_time s - CONNECT_TIME: $upstream_connect_time s - P.. 더보기 NGINX에서 POST 데이터를 액세스 로그에 기록하는 방법 POST 데이터를 NGINX 액세스 로그에 기록하는 방법 NGINX에서 POST 데이터를 액세스 로그에 기록하려면 log_format 디렉티브를 사용하여 로그 형식을 정의하고 $request_body 변수를 포함시키면 됩니다. 다음은 POST 데이터를 액세스 로그에 기록하는 예시입니다. 1. nginx 설정 파일 (nginx.conf 또는 사이트 구성 파일)을 엽니다. 2. http 블록 내에 있는 log_format 디렉티브를 찾습니다. 만약 log_format 디렉티브가 없다면 새로 추가해야 합니다. 3. 다음과 같이 log_format 디렉티브를 정의하고 $request_body 변수를 사용하여 POST 데이터를 포함시킵니다. http { log_format custom_log '$remote_ad.. 더보기 nginx에서 limit_conn 및 limit_req 모듈 사용하기 nginx에서 limit_conn 및 limit_req 모듈 사용하기nginx의 limit_conn 및 limit_req 모듈은 서버의 요청을 제어하고 과도한 연결 및 요청으로부터 서버를 보호하는 데 사용됩니다. 이러한 기능을 사용하면 서버의 성능을 유지하면서 DDoS 공격 및 과도한 트래픽으로 인한 서버 과부하를 방지할 수 있습니다.limit_conn 모듈특정 클라이언트(IP)별로 동시 연결 수를 제한합니다.(클라이언트의 동시 연결 수를 제한)$ vim /etc/nginx/nginx.confhttp {... # "ddos_conn"이라는 limit zone 정의 (메모리 크기 10MB) limit_conn_zone $http_x_forwarded_for zone=ddos_conn:10m; .. 더보기 이전 1 ··· 3 4 5 6 7 다음