# Nginx 功能 # 需要自己建立的檔案 ``` default.conf ai_api.intemotech.com.conf (主機域名) nginx.conf ``` ## log 分開 ``` config/sites/ai_api.intemotech.com.conf 第5行 access_log /var/log/nginx/ai_api.intemotech.com.access.log main; main 是因為 /home/ubuntu/work/ai/config/nginx.conf 第12行 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; ``` ## 錯誤訊息 log ``` config/sites/ai_api.intemotech.com.conf 第5行 error_log /var/log/nginx/ai_api.intemotech.com.error.log warn; 記錄 warn, error crit, alert 和 emerg 級別的消息 ``` ## 其他參數 ``` gzip_comp_level 6 壓縮等級,可設定 1 ~ 9 的整數,數字越大表示壓縮的量越大,也越吃資源,請看個人環境而定 gzip_types [mime-types] 指定需要壓縮的 MIME types,或用 * 表示所有 MIME types proxy_headers_hash_bucket_size ; #nginx伺服器申請存放http報文頭的哈希表容量大小 proxy_headers_hash_max_size ; #存放http報文頭的哈希表容量上限,默認為512個字符。 proxy_pass 指定ip+port位置 add_header 與 CORS 有關後需可能需要?? 2 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up