본문 바로가기
Tool/Nginx

[NGINX] 3-5. Configuration-try_files, Named Locations

by 건빵거늬 2021. 12. 18.

cf-1. 바보개발자님 블로그 먼저 보기

https://minholee93.tistory.com/entry/Nginx-Try-Files-Named-Location?category=926406 

 

[Nginx] Try Files & Named Location

이전글에 이어서 Nginx의 configuartion에 대해 알아보도록 하겠습니다. 7. Try Files try files은 server & location context에서 사용합니다. try files은 rewrite와 비슷하게 모든 request에 대해 일치하는 pat..

minholee93.tistory.com

cf-2. nginx doc - try_files

https://nginx.org/en/docs/http/ngx_http_core_module.html#try_files

 

Module ngx_http_core_module

Module ngx_http_core_module Directives Syntax: absolute_redirect on | off; Default: absolute_redirect on; Context: http, server, location This directive appeared in version 1.11.8. If disabled, redirects issued by nginx will be relative. See also server_na

nginx.org

 

1. try_files 실습

2. uri가 위치하는 try_files 마지막부분은 named location을 사용해도 된다

named location을 사용하면 rewrite후 re-evaluate를 생략한다. 따라서 바로 $freindly_404를 찾아서 return한다.

댓글