變數

type
status
date
slug
summary
tags
category
icon
password

如何宣告變數

NGINX 中的變數與其他程式語言中的變數類似。
set 指令可用於在設定檔中的任何位置聲明新變數:

變數有三種型別

  • String
  • Integer
  • Boolean

範例一

只要有修改 nginx.conf
  1. sudo nginx -t 確定沒錯誤
  1. sudo nginx -s reload 重新讀取配置

範例二

這裡演示的變數嵌入在 ngx_http_core_module 中。為了在配置中存取變量,必須使用 嵌入變數 的模組來建立 NGINX。

參考文章

地點匹配基礎知識
Loading...
目錄