Web Server/nginx(23)
-
Nginx Ubuntu nginx: [emerg] unknown directive "stream" in /etc/nginx/nginx.conf:307
증상stream 모듈이 보이지 않지만, postreSQL을 proxy할 때는 잘 작동함특정 시점에 error 로그에 해당 내용이 남음인증서 갱신할때도 stream관련 문구를 해석하지 못하는 문제 있음확인nginx -V조치: 모듈 재설치모듈을 재설치해도 conf 파일은 덮어치지 않음./configure \기존 적용 내용 ..--with-stream# 하는 김에 dynamic도 추가함--with-stream=dynamicsudo make install확인 및 재시작sudo nginx -tsudo systemctl restart nginx# 확인nginx -V
2025.02.03 -
차단 IP 목록
# Deny access for the specific IP address deny 62.84.180.29; deny 195.7.4.153; deny 94.23.203.107; deny 188.165.215.206; deny 142.93.84.58; deny 64.227.15.250; deny 50.116.34.59; deny 95.217.195.123; deny 165.227.30.100; deny 142.93.24.112; deny 167.71.20.83; deny 206.189.218.226; deny 81.167.26.57; ..
2025.02.01 -
Nginx 특정 IP 막기
error.log에 이상한 접속이 있어서 해당 IP의 접근 차단server { listen 80; server_name {도메인}; # Deny access for the specific IP address deny {ip}; allow all; # Other configuration settings root {디렉토리}; index index.html index.htm; # ... additional configuration ...}
2025.02.01 -
Nginx 414 Request-URI Too Large 에러 조치
GET 호출에 대한 길이 제한 조치http { large_client_header_buffers 4 16k;}POST 호출에 대한 길이 제한 조치client_max_body_size 50M; Reverse Proxy 길이 제한 조치proxy_buffer_size 128k;proxy_buffers 4 256k;proxy_busy_buffers_size 256k;nginx 재시작sudo systemctl restart nginx
2025.01.30 -
Nginx 80port를 443port로 redirect 하기
http://test.co.kr로 오는 요청을 https://test.co.kr로 redirect함server { listen 80; listen [::]:80; server_name test.co.kr, temp.co.kr; location / { return 301 https://$host$request_uri; }}만약 temp.co.kr이 여기에 포함되어 있지 않으면, http://temp.co.kr로 호출시, http://test.co.kr이 작함
2025.01.30 -
Nginx 파일 업로드 용량 제한 조치
용량이 충분하지 않을 경우 에러아래와 같이 브라우져에 찍힘413 (Request Entity Too Large)access log에도 413이 찍힘nginx.conf 설정nginx는 업로드 기본값이 1M아래 중 1개만 하면 됨http { client_max_body_size 100M;}server { listen 80; server_name example.com; client_max_body_size 100M;}location /upload { client_max_body_size 100M;}nginx에 적용sudo systemctl reload nginxnginx 설정을 변경했으나, 계속 에러 발생하면 그 뒤단에 있는 서버들을 확인해야 함(nginx ingress contro..
2024.12.30