WEB/Nginx

· WEB/Nginx
1. Nginx 설정${NGINX_HOME}/conf/ 디렉터리 내에서 nginx.conf 혹은 default.conf 파일을 설정한다. WAS에서는 http 혹은 https Listener만 설정되어 있으면 된다.1.1. nginx.conf# http WAS 아이피 및 Port 설정http { include mime.types; upstream was { ip_hash; server ${WAS_SERVER_IP1}:8180 weight=5; server ${WAS_SERVER_IP2}:8180; server backup.com backup; # backup Server 지정 } server { listen 80; location / { proxy_pass ; pro..
· WEB/Nginx
Nginx 설정 파일Nginx 설정 파일은 nginx.conf이며, ${NGINX_HOME}/conf 디렉터리에 존재한다.1. nginx.conf아래는 nginx.conf 파일 예시이다.user web; # nginx 프로세스를 기동 시키는 계정worker_processes 1;error_log logs/error.log debug;pid logs/nginx.pid;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] ..
· WEB/Nginx
개  요Nginx사용 시 File Upload 서비스를 수행하다가 HTTP 413 client intended to send too large body 에러를 확인한 경우 해결하는 방법을 정리하였다.1. 원  인Nginx의 경우 최대 용량을 지정하는 옵션인 client_max_body_size가 있다. 해당 옵션 값의 기본값은 1m이며 HTTP Client의 Content-Length 헤더값이 이보다 클 경우 Nginx는 HTTP 413 Error(Requeset Entity Too Large)를 전송하며 위와 같은 메시지 화면을 보여준다.Nginx 로그에는 아래와 같은 내용이 확인 된다.2024/10/15 05:54:59 [error] 242: *160826 client intended to send ..
· WEB/Nginx
Nginx ${NGINXDIR}/sbin 디렉토리가 $PATH에 잡혀있어야 한다. 1. nginx 기동 $ nginx -p ${NGINXDIR} 2. 기동 후 프로세스 확인 $ ps -ef | grep nginx #아래와 같이 프로세스 기동 확인됨 root 287789 1 0 17:08 ? 00:00:00 nginx: master process nginx web 287790 287789 0 17:08 ? 00:00:00 nginx: worker process 3. nginx 다운 # 즉시종료 $ nginx -k stop # 요청 처리후 종료 $ nginx -s quit 기동 시 문제상황 1. 포트 바인딩 문제 nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permi..
JOTAN
'WEB/Nginx' 카테고리의 글 목록