
서버에서 존재하지 않는 페이지 혹은 서버 에러가 났을 때 Nginx 설정만으로도 에러 페이지를 출력할 수 있습니다. 설정하는 법은 nginx.conf 내의 http를 수정하면 됩니다. http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; ..

Nginx 에서 에러가 났을 때 로그를 확인하기 위해서는 error_log.log 파일을 출력하여야 합니다. 이는 nginx.conf 설정에서 설정이 가능하고 어디에 출력이 되는지 path 설정도 가능합니다. http { ... server { access_log /var/log/nginx/default/access.log; error_log /var/log/nginx/default/error.log; } } 또는 서버에 따라 에러를 설정해주는 방법은 위의 글에서 default 대신 다른 서버명을 넣어두 됩니다. http { ... server { access_log /var/log/nginx/${server}/access.log; error_log /var/log/nginx/${server}/error..