nginx 로드밸런싱
# Web&WAS/Nginx2022. 5. 17. 19:27nginx 로드밸런싱

upstream 만들기 upstream { server : ... server : } upstream balance { server localhost:8080; #tomcat1 server localhost:8090; #tomcat2 #loadbalancer type defualt is roundrobin } server { listen 80; location / { proxy_pass http://balance; } } Load balancing 알고리즘 nginx는 여러가지 Load balancing 알고리즘을 지원한다. 분배하다 기준이 비슷한 정도의 서버가 여러대 있다면 그중에서 Round-robin를 돌린다. ■ hash : 바로 뒤에 따라오는 값에 따라 해싱하여 분배한다. hash $remote..

nginx php 연동
# Web&WAS/Nginx2022. 5. 17. 07:50nginx php 연동

#server 구문에 추가 error_page 500 502 503 504 /usr/local/nginx/html/50x.html; location = /usr/local/nginx/html/50x.html { root html; location ~ \.php$ { #PHP-FPM에서 지정한 IP와 포트를 입력합니다. fastcgi_pass 192.168.85.177:9001; #PHP-FPM에 전달하게될 스크립트 파일명 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #FastCGI 관련 구성 설정 정보를 포함합니다. include fastcgi_params; }

nginx SSL 설정 및 적용
# Web&WAS/Nginx2022. 5. 17. 07:48nginx SSL 설정 및 적용

# HTTPS server # server { listen 443 ssl; server_name nikeshoes.shop; ssl_certificate /etc/letsencrypt/live/nikeshoes.shop/cert.pem; ssl_certificate_key /etc/letsencrypt/live/nikeshoes.shop/privkey.pem; ssl_client_certificate /etc/letsencrypt/live/nikeshoes.shop/fullchain.pem; ssl_protocols TLSv1.2; # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ss..

nginx 설치
# Web&WAS/Nginx2022. 5. 17. 07:48nginx 설치

https://nginx.org nginx news 2021-11-18unit-1.26.0 version has been released, featuring multiple improvements in static content serving, application-wide PHP opcache, and a number of bugfixes. nginx.org 설치환경 centos7 nginx, openssl, pcre, zlib 다운로드 및 압축해제 $ wget https://nginx.org/download/nginx-1.20.2.tar.gz $ tar -xvf nginx-1.20.2.tar.gz $ cd nginx-1.20.2 $ wget https://github.com/PCRE2Project/p..

image