nginx 配置說明

2022-10-08 23:51:22 字數 904 閱讀 6560

1

# 客戶端請求正文的最大允許大小

2# 這個大小的非常重要,如果git版本庫里有大檔案,設定的太小,檔案push會失敗,根據情況調整

3client_max_body_size 50m;45

# 安全相關 header

6# 禁止**被嵌入到其它網頁中,如:iframe、embed等,sameorigin表示該頁面僅能在相同網域名稱頁面的iframe中展示

7 add_header x-frame-options "

sameorigin

"always;

8# 當檢測到xss攻擊時阻止頁面載入

9 add_header x-xss-protection "

1; mode=block

"always;

10 # 禁止請求型別為style和script時,但mime型別卻不為text/css和j**ascript的請求

11 add_header x-content-type-options "

nosniff

"always;

1213

proxy_redirect off;

14 #以下確保 gitlab中專案的 url 是網域名稱而不是 http://

git,不可缺少

15proxy_set_header host $host;

16 proxy_set_header x-real-ip $remote_addr;

17 proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;

18# 反向**到 gitlab 內建的 nginx

nginx 配置說明

定義nginx執行的使用者和使用者組 user www www nginx程序數,建議設定為等於cpu總核心數。worker processes 8 全域性錯誤日誌定義型別,debug info notice warn error crit error log ar loginx error.log...

nginx配置說明

依賴 zlib,pcre,openssl configure prefix usr local nginx with openssl usr include 啟用ssl with pcre usr include pcre 啟用正規表示式 with http stub status module 安...

Nginx配置說明

nginx配置引數中文詳細說明 定義nginx執行的使用者和使用者組 user www www nginx程序數,建議設定為等於cpu總核心數.worker processes 8 全域性錯誤日誌定義型別,debug info notice warn error crit error log var...