본문 바로가기

반응형

nginx

[리눅스] nginx php-fpm 연동 nginx php-fpm 연동 NGINX 설치하기 https://scbyun.com/1078 PHP-FPM 설치하기 https://scbyun.com/1080 nginx(fastcgi_params) 설정 cat /etc/nginx/fastcgi_params fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info; EOF (or) vim /etc/nginx/fastcgi_params $ vim /etc/nginx/fastcgi_params ... fastc.. 더보기
[리눅스] NGINX 및 PHP에서 파일 업로드 크기 제한을 변경하는 방법 NGINX 및 PHP에서 파일 업로드 크기 제한을 변경하는 방법 1. NGINX에서 파일 업로드 크기 제한 변경 NGINX에서 파일 업로드 크기 제한을 변경하려면 다음과 같은 단계를 따릅니다. 1-1. NGINX 구성 파일을 엽니다. 일반적으로 /etc/nginx/nginx.conf 파일입니다. 1-2. http 블록 안에 다음 라인을 추가합니다. vim /etc/nginx/nginx.conf client_max_body_size 20M; 이 예에서는 20MB를 최대 파일 업로드 크기로 설정했습니다. 1-3. 구성 파일을 저장하고 NGINX를 다시 로드합니다. sudo service nginx reload 2. PHP에서 파일 업로드 크기 제한 변경 PHP에서 파일 업로드 크기 제한을 변경하려면 다음과 .. 더보기
[리눅스] NGINX 최신(안정 버전) 버전 설치하기 NGINX 최신(안정 버전) 버전 설치하기 nginx : High performance web server http://nginx.org/en/linux_packages.html#RHEL-CentOS 테스트 환경 $ cat /etc/os-release | grep PRETTY_NAME | cut -d '"' -f 2 CentOS Linux 7 (Core) EPEL 및 YUM Utilities 패키지 설치 yum install -y epel-release yum-utils nginx.repo 파일 생성 sudo tee /etc/yum.repos.d/nginx.repo 더보기
[용어] RPS(Request Per Second) RPS(Request Per Second) : 초당 접속자 수 Request Per Second (RPS)는 일정 시간 동안 수신한 요청(Request)의 총 개수를 초(second) 단위로 나눈 것으로, 단위 시간당 처리할 수 있는 요청의 수를 나타내는 지표입니다. 일반적으로 웹 서버나 API 서버에서 RPS는 서비스의 성능을 측정하는 중요한 지표 중 하나입니다. 클라이언트에서 서버로 보내는 요청의 수가 많을수록 높은 RPS를 달성하기 위해서는 서버가 빠르게 요청을 처리하고 응답을 반환해야 합니다. 따라서, RPS는 서버의 성능을 측정하고 최적화하는 데 중요한 지표입니다. 예를 들어, 웹 서버에서 1초 동안 1000개의 요청을 처리했다면, 해당 웹 서버의 RPS는 1000입니다. 이는 웹 서버가 1초 .. 더보기
[리눅스] nginx 공격 아이피(attacker ip) 추출 nginx 공격 아이피(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.222.222.229 44 222.22.. 더보기
[리눅스] 취약점을 방지하기 위한 보안 HTTP 헤더를 설정하기 취약점을 방지하기 위한 보안 HTTP 헤더를 설정하기 X-Content-Type-Options ###Apache Header set X-Content-Type-Options nosniff ###Nginx add_header X-Content-Type-Options nosniff; X-XSS-Protection ###Apache Header set X-XSS-Protection "1; mode=block" ###Nginx add_header X-XSS-Protection "1; mode=block"; X-Frame-Options ###Apache Header always append X-Frame-Options DENY ###Nginx add_header X-Frame-Options “DENY”; HTTP.. 더보기
[리눅스] 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; allow 10.11.0.0/16; allow 10.21.0.0/16; allow .. 더보기
[리눅스] NGINX 및 PHP-FPM access logs 설정 NGINX 및 PHP-FPM 액세스 로그 설정 nginx access logs format $ vim /etc/nginx/nginx.conf ... 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 - PHP-FPM_STATUS: $upstream_status'; $ nginx -t nginx: the configuration file /etc/ng.. 더보기

728x90
반응형