주 메뉴 열기

wwiki β

바뀜

Nginx

1,793 바이트 추가됨, 2019년 4월 20일 (토) 02:40
편집 요약 없음
== 보안설정 ==
<nowiki>#</nowiki>/etc/nginx/nginx.conf
 
=== 서버 버전 숨기기 등 ===
<syntaxhighlight lang="nginx">
http{
# 서버 버전 숨기기
server_tokens off;
# 개발언어 숨기기
fastcgi_hide_header X-Powered-By;
proxy_hide_header X-Powered-By;
# http 프로토콜에서 xml 데이터를 전송하기위해 사용되는데, 특별한 용도가 없다면 막아두는것이 좋다.
fastcgi_hide_header X-Pingback;
proxy_hide_header X-Pingback;
# xml 관련된 W3c 표준이긴한데, 특별한 용도가 없다면 막아두는것이 좋다.
fastcgi_hide_header Link;
proxy_hide_header X-Link;
...
}
 
 
</syntaxhighlight>
 
=== 첫 페이지 제거 ===
<syntaxhighlight lang="nginx">
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
return 404;
}
 
</syntaxhighlight>
 
=== 특정url제거 ===
<syntaxhighlight lang="nginx">
location /share2 {
 
return 404;
}
 
</syntaxhighlight>
 
=== 에러페이지 제거 ===
<syntaxhighlight lang="nginx">
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error.html;
 
location = /error.html {
 
internal;
}
 
</syntaxhighlight>
 
==== error.html ====
<syntaxhighlight lang="html">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 
"http://www.w3.org/TR/html4/loose.dtd">
 
<html>
 
<head>
 
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
 
</head>
 
<body>
 
<center>
 
<br><h1>ERROR</h1>
 
</center>
 
</body>
 
</html>
 
</syntaxhighlight>
 
=== 해외아이피 차단 ===
nginx 옵션 확인: --with-http_geoip_module=dynamic
 
==에러==
client_max_body_size 512M;
=== SSL routines:tls_process_client_hello:version too low ===
IE 6.0등 브라우저 버전이 낮은 경우에 발생한 보안에러이다.
편집
2,431