파일명은 *.config
서버가 여러개 있을 수 있다
port ≤ 65535)
host:port 의 첫 번째 서버는 해당 host:port 의 기본 서버가 된다.
(다른 서버에 속하지 않는 모든 쿼리에 응답)
host != server_name에러 페이지 세팅 (없으면 기본 에러 페이지)
location 세팅
location 에 허용된 HTTP 메소드 나열autoindex (directory listing) on/offserver와 location 와 같이 여는 괄호 { 가 있는 경우는 키워드와 괄호 사이에 공백 하나만 허용한다.
cgi 블록 세팅
location 안에 method 가 정의 돼있지 않으면 GET 만 허용location 안에 root / index 없으면 location 경로가 기본 root 로 설정, index.html 이 기본 index 로 설정server_name 없으면 empty stringerror.htmllocation 안에 autoindex 없으면 off.config file 예시server {
listen HOST:NUMBER
server_name HOST
error 40x.html
location PATH {
root PATH
index FILE
methods GET POST DELETE
body_max NUMBER
autoindex BOOLEAN
upload_path PATH
redirect_to ROUTE
}
cgi .php {
root PATH
methods GET POST
body_max NUMBER(only POST)
}
}