- 發布於
Nginx Configuration for starter

關於 Nginx 相關設定,目前只有 Location 相關,未來會持續更新
Location
::: tip 解析順序
- Exact match
= url
- Preferential Prefix match
^~ url
- REGEX match
~ regex_url
or~* regex_url
- Prefix match
url
:::
Prefix match
location /Greet2 {
return 200 'Hello from NGINX "/greet" location.';
}
Preferential Prefix match
location ^~ /Greet2 {
return 200 'Hello from NGINX "/greet" location.';
}
Exact match
location = /greet {
return 200 'Hello from NGINX "/greet" location - EXACT MATCH.';
}
REGEX match - case sensitive
location ~ /greet[0-9] {
return 200 'Hello from NGINX "/greet" location - REGEX MATCH.';
}
REGEX match - case insensitive
location ~* /greet[0-9] {
return 200 'Hello from NGINX "/greet" location - REGEX MATCH INSENSITIVE.';
}