nginx 썸네일형 리스트형 NGINX 및 PHP 파일 업로드 크기 제한 변경 NGINX 및 PHP(PHP-FPM) 파일 업로드 크기 제한 변경NGINX와 PHP-FPM 환경에서 파일 업로드 용량을 50MB로 늘리는 방법입니다.NGINX 설정 변경최대 파일 업로드 크기를 50MB로 설정합니다. 설정 파일 수정(nginx.conf, default.conf)NGINX에서는 client_max_body_size 값을 설정합니다.http 블록 설정vim /etc/nginx/nginx.confhttp { ... client_max_body_size 50M; ...}서버 블록 설정vim /etc/nginx/conf.d/default.confserver { listen 80; server_name scbyun.com; location / { .. 더보기 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.. 더보기 이전 1 ··· 3 4 5 6 7 다음