본문 바로가기
Nginx

에러페이지 (404, 500, 502, 503, 504) 발생시 특정페이지로 보내기

by ohrohi 2019. 11. 27.

에러페이지 (404, 500, 502, 503, 504) 발생시 특정페이지로 보내는 설정방법

 

vi default.conf or default_ssl.conf

 

server {

...

  location / {

    proxy_intercept_errors on;

    proxy_pass http://localhost:8090/;  -> 해당도메인의포트로 요청시 conf에 설정된 포트로 리다이렉팅 해주는 설정

  }

  error_page 404 500 502 503 504 /idnex.html;

  location = /index.html {

    root /index.html파일이 위치한곳;

    internal;

  }



이러면 설정해놓은 파일로 잘 넘어간다.

'Nginx' 카테고리의 다른 글

http를 https로 리다이렉팅 시키기  (0) 2019.10.31
nginx 포트 proxy 설정  (0) 2019.10.30