ngx_http_uwsgi_module

ngx_http_uwsgi_module λͺ¨λ“ˆμ„ 톡해 uwsgi μ„œλ²„μ— μš”μ²­μ„ 전달할 수 μžˆμŠ΅λ‹ˆλ‹€.

예제 ꡬ성

location / {
    include    uwsgi_params;
    uwsgi_pass localhost:9000;
}

Directives

Syntax:  uwsgi_bind address [transparent] | off;
Default: β€”
Context: http, server, location

uwsgi μ„œλ²„λ‘œ λ‚˜κ°€λŠ” 연결이 포트 μ˜΅μ…˜μ΄ μžˆλŠ” 둜컬 IP μ£Όμ†Œμ—μ„œ μ‹œμž‘λ˜λ„λ‘ ν•©λ‹ˆλ‹€(1.11.2). λ§€κ°œλ³€μˆ˜ κ°’μ—λŠ” λ³€μˆ˜(1.3.12)κ°€ 포함될 수 μžˆμŠ΅λ‹ˆλ‹€. 특수 κ°’ off(1.3.12)λŠ” 이전 ꡬ성 μˆ˜μ€€μ—μ„œ μƒμ†λœ uwsgi_bind λͺ…λ Ήμ˜ 효과λ₯Ό μ·¨μ†Œν•˜κ³  이λ₯Ό 톡해 μ‹œμŠ€ν…œμ€ 둜컬 IP μ£Όμ†Œ 및 포트λ₯Ό μžλ™ ν• λ‹Ήν•  수 μžˆμŠ΅λ‹ˆλ‹€.

transparent λ§€κ°œλ³€μˆ˜(1.11.0)λ₯Ό 톡해 uwsgi μ„œλ²„λ‘œ λ‚˜κ°€λŠ” 연결은 λΉ„λ‘œμ»¬ IP μ£Όμ†Œ, 예λ₯Ό λ“€μ–΄ ν΄λΌμ΄μ–ΈνŠΈμ˜ μ‹€μ œ IP μ£Όμ†Œμ—μ„œ μ‹œμž‘λ˜λ„λ‘ ν•©λ‹ˆλ‹€.

uwsgi_bind $remote_addr transparent;

이 λ§€κ°œλ³€μˆ˜κ°€ μž‘λ™ν•˜κΈ° μœ„ν•΄μ„œλŠ” 일반적으둜 슈퍼 μ‚¬μš©μž κΆŒν•œμœΌλ‘œ nginx μž‘μ—…μž ν”„λ‘œμ„ΈμŠ€λ₯Ό μ‹€ν–‰ν•΄μ•Ό ν•©λ‹ˆλ‹€. Linuxμ—μ„œ 이것은 transparent λ§€κ°œλ³€μˆ˜κ°€ μ§€μ •λœ κ²ƒμ²˜λŸΌ ν•„μˆ˜κ°€ μ•„λ‹ˆκ³ (1.13.8) μž‘μ—…μž ν”„λ‘œμ„ΈμŠ€λŠ” λ§ˆμŠ€ν„° ν”„λ‘œμ„ΈμŠ€μ—μ„œ CAP_NET_RAW κΈ°λŠ₯을 μƒμ†ν•©λ‹ˆλ‹€. uwsgi μ„œλ²„μ—μ„œ λ„€νŠΈμ›Œν¬ νŠΈλž˜ν”½μ„ κ°€λ‘œμ±„λ„λ‘ 컀널 λΌμš°νŒ… ν…Œμ΄λΈ”λ„ ꡬ성해야 ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_buffer_size size;
Default: uwsgi_buffer_size 4k|8k;
Context: http, server, location

uwsgi μ„œλ²„μ—μ„œ 받은 μ‘λ‹΅μ˜ 첫 뢀뢄을 μ½λŠ” 데 μ‚¬μš©λ˜λŠ” 버퍼λ₯Ό μ„€μ • ν•©λ‹ˆλ‹€. μ΄ 뢀뢄은 일반적으둜 μž‘μ€ 응닡 헀더λ₯Ό 포함합uwsgi μ„œλ²„μ—μ„œ μˆ˜μ‹ ν•œ μ‘λ‹΅μ˜ 첫 번째 뢀뢄을 μ½λŠ” 데 μ‚¬μš©λ˜λŠ” λ²„νΌμ˜ 크기λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. 이 λΆ€λΆ„μ—λŠ” 일반적으둜 μž‘μ€ 응닡 헀더가 ν¬ν•¨λ©λ‹ˆλ‹€. 기본적으둜 버퍼 ν¬κΈ°λŠ” λ©”λͺ¨λ¦¬ νŽ˜μ΄μ§€ 1κ°œμ™€ κ°™μŠ΅λ‹ˆλ‹€. ν”Œλž«νΌμ— 따라 4K λ˜λŠ” 8Kκ°€ λ©λ‹ˆλ‹€. ν•˜μ§€λ§Œ ν¬κΈ°λŠ” 더 쀄일 수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_buffering on | off;
Default: uwsgi_buffering on;
Context: http, server, location

uwsgi μ„œλ²„μ—μ„œ μ‘λ‹΅μ˜ 버퍼링을 ν™œμ„±ν™”ν•˜κ±°λ‚˜ λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

버퍼링이 ν™œμ„±ν™”λ˜λ©΄ nginxλŠ” κ°€λŠ₯ν•œ ν•œ 빨리 uwsgi μ„œλ²„μ—μ„œ 응닡을 μˆ˜μ‹ ν•˜μ—¬ uwsgi_buffer_size 및 uwsgi_buffers λͺ…λ ΉμœΌλ‘œ μ„€μ •λœ 버퍼에 μ €μž₯ν•©λ‹ˆλ‹€. 전체 응닡이 λ©”λͺ¨λ¦¬μ— λ§žμ§€ μ•ŠμœΌλ©΄ 일뢀λ₯Ό λ””μŠ€ν¬μ˜ μž„μ‹œ νŒŒμΌμ— μ €μž₯ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μž„μ‹œ νŒŒμΌμ— μ“°κΈ°λŠ” uwsgi_max_temp_file_size 및 uwsgi_temp_file_write_size λͺ…λ ΉμœΌλ‘œ μ œμ–΄λ©λ‹ˆλ‹€.

버퍼링이 λΉ„ν™œμ„±ν™”λ˜λ©΄ 응닡이 μˆ˜μ‹ λ˜μžλ§ˆμž ν΄λΌμ΄μ–ΈνŠΈλ‘œ λ™μ‹œμ— μ „λ‹¬λ©λ‹ˆλ‹€. nginxλŠ” uwsgi μ„œλ²„μ—μ„œ 전체 응닡을 읽으렀 ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. nginxκ°€ ν•œ λ²ˆμ— μ„œλ²„μ—μ„œ μˆ˜μ‹ ν•  수 μžˆλŠ” λ°μ΄ν„°μ˜ μ΅œλŒ€ ν¬κΈ°λŠ” uwsgi_buffer_size λͺ…λ ΉμœΌλ‘œ μ„€μ •λ©λ‹ˆλ‹€.

버퍼링은 “X-Accel-Buffering” 응닡 헀더 ν•„λ“œμ—μ„œ “예” λ˜λŠ” “μ•„λ‹ˆμš””λ₯Ό μ „λ‹¬ν•˜μ—¬ ν™œμ„±ν™”ν•˜κ±°λ‚˜ λΉ„ν™œμ„±ν™”ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€. 이 κΈ°λŠ₯은 uwsgi_ignore_headers λͺ…령을 μ‚¬μš©ν•˜μ—¬ λΉ„ν™œμ„±ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_buffers number size;
Default: uwsgi_buffers 8 4k|8k;
Context: http, server, location

단일 μ—°κ²°μ˜ 경우 uwsgi μ„œλ²„μ—μ„œ 응닡을 μ½λŠ” 데 μ‚¬μš©λ˜λŠ” λ²„νΌμ˜ 수 및 크기λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. 기본적으둜 버퍼 ν¬κΈ°λŠ” λ©”λͺ¨λ¦¬ νŽ˜μ΄μ§€ 1κ°œμ™€ κ°™μŠ΅λ‹ˆλ‹€. ν”Œλž«νΌμ— 따라 4K λ˜λŠ” 8Kκ°€ λ©λ‹ˆλ‹€.

Syntax:  uwsgi_busy_buffers_size size;
Default: uwsgi_busy_buffers_size 8k|16k;
Context: http, server, location

uwsgi μ„œλ²„μ˜ 응닡 버퍼링이 ν™œμ„±ν™”λ˜λ©΄ ν΄λΌμ΄μ–ΈνŠΈμ— 응닡을 μ „μ†‘ν•˜λŠ” 데 μ‚¬μš©ν•  수 μžˆλŠ” λ²„νΌμ˜ 총 크기가 μ œν•œλ˜κ³  응닡이 아직 μ™„μ „νžˆ μ½νžˆμ§€ μ•ŠμŠ΅λ‹ˆλ‹€. κ·Έλ™μ•ˆ λ‚˜λ¨Έμ§€ 버퍼가 응닡을 μ½λŠ” 데 μ‚¬μš©λ  수 있고 ν•„μš”ν•œ 경우 μž„μ‹œ νŒŒμΌμ— λŒ€ν•œ μ‘λ‹΅μ˜ 버퍼링 뢀뢄이 μ‚¬μš©λ©λ‹ˆλ‹€. 기본적으둜, ν¬κΈ°λŠ” uwsgi_buffer_size 및 uwsgi_buffers λͺ…λ ΉμœΌλ‘œ μ„€μ •λœ 2개 λ²„νΌμ˜ 크기둜 μ œν•œλ©λ‹ˆλ‹€.

Syntax:  uwsgi_cache zone | off;
Default: uwsgi_cache off;
Context: http, server, location

캐싱에 μ‚¬μš©λ˜λŠ” 곡유 λ©”λͺ¨λ¦¬ μ˜μ—­μ„ μ •μ˜ν•©λ‹ˆλ‹€. λ™μΌν•œ μ˜μ—­μ΄ μ—¬λŸ¬ μœ„μΉ˜μ—μ„œ μ‚¬μš©λ  수 μžˆμŠ΅λ‹ˆλ‹€. λ§€κ°œλ³€μˆ˜ κ°’μ—λŠ” λ³€μˆ˜(1.7.9)κ°€ 포함될 수 μžˆμŠ΅λ‹ˆλ‹€. off λ§€κ°œλ³€μˆ˜λŠ” 이전 ꡬ성 μˆ˜μ€€μ—μ„œ μƒμ†λœ 캐싱을 λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_cache_background_update on | off;
Default: uwsgi_cache_background_update off;
Context: http, server, location
This directive appeared in version 1.11.10.

λ°±κ·ΈλΌμš΄λ“œ ν•˜μœ„ μš”μ²­μ„ μ‹œμž‘ν•˜μ—¬ 만료된 μΊμ‹œ ν•­λͺ©μ„ μ—…λ°μ΄νŠΈν•  수 있고 κ·Έλ™μ•ˆ 였래된 μΊμ‹œλœ 응닡이 ν΄λΌμ΄μ–ΈνŠΈλ‘œ λ°˜ν™˜λ©λ‹ˆλ‹€. 였래된 μΊμ‹œλœ 응닡이 μ—…λ°μ΄νŠΈλ  λ•Œ ν•΄λ‹Ή μ‘λ‹΅μ˜ μ‚¬μš©μ„ ν—ˆμš©ν•΄μ•Ό ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_cache_bypass string ...;
Default: β€”
Context: http, server, location

μΊμ‹œμ—μ„œ 응닡을 κ°€μ Έμ˜€μ§€ μ•ŠλŠ” 쑰건을 μ •μ˜ν•©λ‹ˆλ‹€. λ¬Έμžμ—΄ λ§€κ°œλ³€μˆ˜μ˜ ν•˜λ‚˜ μ΄μƒμ˜ 값이 λΉ„μ–΄ μžˆμ§€ μ•Šκ³  “0”κ³Ό κ°™μ§€ μ•ŠμœΌλ©΄ μΊμ‹œμ—μ„œ 응닡을 κ°€μ Έμ˜€μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

uwsgi_cache_bypass $cookie_nocache $arg_nocache$arg_comment;
uwsgi_cache_bypass $http_pragma    $http_authorization;

uwsgi_no_cache λͺ…λ Ήκ³Ό ν•¨κ»˜ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_cache_key string;
Default: β€”
Context: http, server, location

예λ₯Ό λ“€μ–΄, μΊμ‹±μ˜ ν‚€λ₯Ό μ •μ˜ν•©λ‹ˆλ‹€.

uwsgi_cache_key localhost:9000$request_uri;
Syntax:  uwsgi_cache_lock on | off;
Default: uwsgi_cache_lock off;
Context: http, server, location
This directive appeared in version 1.1.12.

ν™œμ„±ν™”λ˜λ©΄ uwsgi μ„œλ²„λ‘œ μš”μ²­μ„ μ „λ‹¬ν•˜μ—¬ ν•œ λ²ˆμ— ν•˜λ‚˜μ˜ μš”μ²­λ§Œ uwsgi_cache_key λͺ…령에 따라 μ‹λ³„λœ μƒˆ μΊμ‹œ μš”μ†Œλ₯Ό μ±„μšΈ 수 μžˆμŠ΅λ‹ˆλ‹€. λ™μΌν•œ μΊμ‹œ μš”μ†Œμ˜ λ‹€λ₯Έ μš”μ²­μ€ uwsgi_cache_lock_timeout λͺ…λ ΉμœΌλ‘œ μ„€μ •λœ μ‹œκ°„κΉŒμ§€ 응닡이 이 μš”μ†Œκ°€ 릴리슀될 μΊμ‹œ λ˜λŠ” μΊμ‹œ μž κΈˆμ— ν‘œμ‹œλ  λ•ŒκΉŒμ§€ κΈ°λ‹€λ¦½λ‹ˆλ‹€.

Syntax:  uwsgi_cache_lock_age time;
Default: uwsgi_cache_lock_age 5s;
Context: http, server, location
This directive appeared in version 1.7.8.

μƒˆ μΊμ‹œ μš”μ†Œλ₯Ό μ±„μš°κΈ° μœ„ν•΄ uwsgi μ„œλ²„λ‘œ μ „λ‹¬λœ λ§ˆμ§€λ§‰ μš”μ²­μ΄ μ§€μ •λœ μ‹œκ°„ λ™μ•ˆ μ™„λ£Œλ˜μ§€ μ•Šμ•˜μœΌλ©΄ uwsgi μ„œλ²„λ‘œ μš”μ²­μ΄ ν•˜λ‚˜ 더 전달될 수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_cache_lock_timeout time;
Default: uwsgi_cache_lock_timeout 5s;
Context: http, server, location
This directive appeared in version 1.1.12.

uwsgi_cache_lock에 λŒ€ν•œ μ‹œκ°„μ œν•œμ„ μ„€μ •ν•©λ‹ˆλ‹€. μ‹œκ°„μ΄ 만료되면 μš”μ²­μ΄ uwsgi μ„œλ²„λ‘œ μ „λ‹¬λ˜μ§€λ§Œ 응닡은 μΊμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

1.7.8 μ΄μ „μ—λŠ” 응닡을 μΊμ‹œν•  수 μžˆμ—ˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_cache_max_range_offset number;
Default: β€”
Context: http, server, location
This directive appeared in version 1.11.6.

λ°”μ΄νŠΈ λ²”μœ„ μš”μ²­μ— λŒ€ν•΄ λ°”μ΄νŠΈ λ‹¨μœ„λ‘œ μ˜€ν”„μ…‹μ„ μ„€μ •ν•©λ‹ˆλ‹€. λ²”μœ„κ°€ μ˜€ν”„μ…‹μ„ λ„˜μ–΄μ„œλ©΄ λ²”μœ„ μš”μ²­μ΄ uwsgi μ„œλ²„λ‘œ μ „λ‹¬λ˜κ³  응닡이 μΊμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_cache_methods GET | HEAD | POST ...;
Default: uwsgi_cache_methods GET HEAD;
Context: http, server, location

ν΄λΌμ΄μ–ΈνŠΈ μš”μ²­ λ©”μ„œλ“œκ°€ 이 λͺ…령에 λ‚˜μ—΄λ˜λ©΄ 응닡이 μΊμ‹œλ©λ‹ˆλ‹€. “GET” 및 “HEAD” λ©”μ„œλ“œλŠ” 항상 λͺ©λ‘μ— μΆ”κ°€λ˜μ§€λ§Œ λͺ…μ‹œμ μœΌλ‘œ μ§€μ •ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. uwsgi_no_cache λͺ…령도 μ°Έμ‘°ν•˜μ„Έμš”.

Syntax:  uwsgi_cache_min_uses number;
Default: uwsgi_cache_min_uses 1;
Context: http, server, location

이후에 응닡이 μΊμ‹œλ˜λŠ” μš”μ²­ 수λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_cache_path path [levels=levels] [use_temp_path=on|off] keys_zone=name:size [inactive=time] 
         [max_size=size] [min_free=size] [manager_files=number] [manager_sleep=time] [manager_threshold=time] 
         [loader_files=number] [loader_sleep=time] [loader_threshold=time] [purger=on|off] [purger_files=number] 
         [purger_sleep=time] [purger_threshold=time];
Default: β€”
Context: http

μΊμ‹œμ˜ κ²½λ‘œμ™€ λ‹€λ₯Έ λ§€κ°œλ³€μˆ˜λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. μΊμ‹œ λ°μ΄ν„°λŠ” νŒŒμΌμ— μ €μž₯λ©λ‹ˆλ‹€. μΊμ‹œμ˜ 파일 이름은 MD5 ν•¨μˆ˜λ₯Ό μΊμ‹œ 킀에 μ μš©ν•œ κ²°κ³Όμž…λ‹ˆλ‹€. levels λ§€κ°œλ³€μˆ˜κ°€ 1~3의 μΊμ‹œ 계측 ꡬ쑰 μˆ˜μ€€μ„ μ •μ˜ν•˜κ³  각 μˆ˜μ€€μ€ κ°’ 1 λ˜λŠ” 2λ₯Ό μˆ˜λ½ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, λ‹€μŒ κ΅¬μ„±μ—μ„œ

uwsgi_cache_path /data/nginx/cache levels=1:2 keys_zone=one:10m;

μΊμ‹œμ˜ 파일 이름은 λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

/data/nginx/cache/c/29/b7f54b2df7773722d382f4809d65029c

μΊμ‹œλœ 응닡은 λ¨Όμ € μž„μ‹œ νŒŒμΌμ— 기둝된 λ‹€μŒ 파일 이름이 λ³€κ²½λ©λ‹ˆλ‹€. 버전 0.8.9λΆ€ν„° μž„μ‹œ 파일과 μΊμ‹œλŠ” λ‹€λ₯Έ 파일 μ‹œμŠ€ν…œμ— 넣을 수 μžˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ 이 경우 λΉ„μš©μ΄ 적게 λ“œλŠ” 이름 λ³€κ²½ μž‘μ—… λŒ€μ‹  2개의 파일 μ‹œμŠ€ν…œ μ „μ²΄μ—μ„œ 파일이 λ³΅μ‚¬λ©λ‹ˆλ‹€. λ”°λΌμ„œ μ£Όμ–΄μ§„ μœ„μΉ˜μ—μ„œ μΊμ‹œμ™€ μž„μ‹œ 파일 포함 디렉터리 λͺ¨λ‘ λ™μΌν•œ 파일 μ‹œμŠ€ν…œμ— λ„£λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. μž„μ‹œ 파일용 λ””λ ‰ν„°λ¦¬λŠ” use_temp_path λ§€κ°œλ³€μˆ˜(1.7.10)λ₯Ό κΈ°μ€€μœΌλ‘œ μ„€μ •λ©λ‹ˆλ‹€. λ§€κ°œλ³€μˆ˜κ°€ μƒλž΅λ˜κ±°λ‚˜ κ°’ on으둜 μ„€μ •λ˜λ©΄ μ£Όμ–΄μ§„ μœ„μΉ˜μ—μ„œ uwsgi_temp_path λͺ…λ ΉμœΌλ‘œ μ„€μ •λœ 디렉터리가 μ‚¬μš©λ©λ‹ˆλ‹€.  값이 off둜 μ„€μ •λ˜λ©΄ μž„μ‹œ 파일이 μΊμ‹œ 디렉터리에 직접 λ°°μΉ˜λ©λ‹ˆλ‹€.

λ˜ν•œ λͺ¨λ“  ν™œμ„± ν‚€ 및 데이터에 λŒ€ν•œ μ •λ³΄λŠ” 곡유 λ©”λͺ¨λ¦¬ μ˜μ—­μ— μ €μž₯λ©λ‹ˆλ‹€. 곡유 λ©”λͺ¨λ¦¬ μ˜μ—­μ˜ 이름 및 ν¬κΈ°λŠ” keys_zone λ§€κ°œλ³€μˆ˜λ‘œ κ΅¬μ„±λ©λ‹ˆλ‹€. ν•˜λ‚˜μ˜ λ©”κ°€λ°”μ΄νŠΈ μ˜μ—­μ€ μ•½ 8천 개 ν‚€λ₯Ό μ €μž₯ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

μƒμ—…μš© κ΅¬λ…μ˜ μΌλΆ€λ‘œ 곡유 λ©”λͺ¨λ¦¬ μ˜μ—­μ€ ν™•μž₯된 μΊμ‹œ 정보도 μ €μž₯ν•˜λ―€λ‘œ λ™μΌν•œ ν‚€ μˆ˜μ— λŒ€ν•΄ 더 큰 μ˜μ—­ 크기λ₯Ό μ§€μ •ν•΄μ•Ό ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, ν•˜λ‚˜μ˜ λ©”κ°€λ°”μ΄νŠΈ μ˜μ—­μ€ μ•½ 4천 개 ν‚€λ₯Ό μ €μž₯ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

inactive λ§€κ°œλ³€μˆ˜λ‘œ μ§€μ •λœ μ‹œκ°„ λ™μ•ˆ μ•‘μ„ΈμŠ€λ˜μ§€ μ•Šμ€ μΊμ‹œλœ λ°μ΄ν„°λŠ” μ΅œμ‹  여뢀에 관계없이 μΊμ‹œμ—μ„œ μ œκ±°λ©λ‹ˆλ‹€. 기본적으둜, λΉ„ν™œμ„±μ€ 10λΆ„μœΌλ‘œ μ„€μ •λ©λ‹ˆλ‹€.

νŠΉμˆ˜ν•œ “μΊμ‹œ κ΄€λ¦¬μž” ν”„λ‘œμ„ΈμŠ€λŠ” max_size λ§€κ°œλ³€μˆ˜λ‘œ μ„€μ •λœ μ΅œλŒ€ μΊμ‹œ 크기와 μΊμ‹œκ°€ ν¬ν•¨λœ 파일 μ‹œμŠ€ν…œμ˜ min_free(1.19.1) λ§€κ°œλ³€μˆ˜λ‘œ μ„€μ •λœ μ΅œμ†Œ μ‚¬μš© κ°€λŠ₯ 곡간 크기λ₯Ό λͺ¨λ‹ˆν„°λ§ν•©λ‹ˆλ‹€. 크기가 μ΄ˆκ³Όλ˜κ±°λ‚˜ μΆ©λΆ„ν•œ μ‚¬μš© κ°€λŠ₯ 곡간이 μ—†μœΌλ©΄ κ°€μž₯ μ΅œκ·Όμ— μ‚¬μš©ν•œ 데이터λ₯Ό μ œκ±°ν•©λ‹ˆλ‹€. λ°μ΄ν„°λŠ” manager_files, manager_threshold 및 manager_sleep λ§€κ°œλ³€μˆ˜(1.11.5)둜 κ΅¬μ„±λœ λ°˜λ³΅μ—μ„œ μ œκ±°λ©λ‹ˆλ‹€. 1회 μ΄ν„°λ ˆμ΄μ…˜μ—μ„œλŠ” manager_files보닀 적은 수의 ν•­λͺ©μ΄ μ‚­μ œλ©λ‹ˆλ‹€(κΈ°λ³Έκ°’: 100). ν•œ 번 반볡의 기간은 manager_threshold λ§€κ°œλ³€μˆ˜λ‘œ μ œν•œλ©λ‹ˆλ‹€(기본적으둜 200λ°€λ¦¬μ΄ˆ). 반볡 사이에 manager_sleep λ§€κ°œλ³€μˆ˜λ‘œ κ΅¬μ„±λœ μΌμ‹œ 쀑지(기본적으둜 50λ°€λ¦¬μ΄ˆ)κ°€ μ‹€ν–‰λ©λ‹ˆλ‹€.

μ‹œμž‘ 1λΆ„ 후에 νŠΉμˆ˜ν•œ “μΊμ‹œ λ‘œλ”” ν”„λ‘œμ„Έμ„œκ°€ μž‘λ™ν•©λ‹ˆλ‹€. 그러면 파일 μ‹œμŠ€ν…œμ— μ €μž₯된 이전에 μΊμ‹œλœ 데이터에 λŒ€ν•œ 정보가 μΊμ‹œ μ˜μ—­μœΌλ‘œ λ‘œλ“œλ©λ‹ˆλ‹€. λ‘œλ”©λ„ 반볡적으둜 μˆ˜ν–‰λ©λ‹ˆλ‹€. 1회 μ΄ν„°λ ˆμ΄μ…˜μ—μ„œλŠ” loader_files보닀 적은 수의 ν•­λͺ©μ΄ λ‘œλ“œλ©λ‹ˆλ‹€(κΈ°λ³Έκ°’: 100). λ˜ν•œ, ν•œ 번의 반볡 기간은 loader_threshold λ§€κ°œλ³€μˆ˜λ‘œ μ œν•œλ©λ‹ˆλ‹€(기본적으둜 200λ°€λ¦¬μ΄ˆ). 반볡 사이에 loader_sleep λ§€κ°œλ³€μˆ˜λ‘œ κ΅¬μ„±λœ μΌμ‹œ 쀑지(기본적으둜 50λ°€λ¦¬μ΄ˆ)κ°€ μ‹€ν–‰λ©λ‹ˆλ‹€.

λ˜ν•œ λ‹€μŒ λ§€κ°œλ³€μˆ˜κ°€ μƒμ—…μš© κ΅¬λ…μ˜ μΌλΆ€λ‘œ μ‚¬μš© κ°€λŠ₯ν•©λ‹ˆλ‹€.

purger=on|off

μ™€μΌλ“œμΉ΄λ“œ 킀와 μΌμΉ˜ν•˜λŠ” μΊμ‹œ ν•­λͺ©μ΄ μΊμ‹œ 퍼저(purger)(1.7.12)에 μ˜ν•΄ λ””μŠ€ν¬μ—μ„œ μ œκ±°λ μ§€λ₯Ό μ§€μ‹œν•©λ‹ˆλ‹€. λ§€κ°œλ³€μˆ˜λ₯Ό on(기본값은 off)으둜 μ„€μ •ν•˜λ©΄ λͺ¨λ“  μΊμ‹œ ν•­λͺ©μ„ 톡해 영ꡬ적으둜 반볡되고 μ™€μΌλ“œμΉ΄λ“œ 킀와 μΌμΉ˜ν•˜λŠ” ν•­λͺ©μ„ μ‚­μ œν•˜λŠ” “μΊμ‹œ 퍼저” ν”„λ‘œμ„ΈμŠ€κ°€ μž‘λ™ν•©λ‹ˆλ‹€.

purger_files=number

ν•œ 번의 반볡 λ™μ•ˆ μŠ€μΊ”λ˜λŠ” ν•­λͺ© 수λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€(1.7.12). 기본적으둜 purger_filesλ₯Ό 10으둜 μ„€μ •ν•©λ‹ˆλ‹€.

purger_threshold=number

ν•œ 번의 반볡 기간이 μ„€μ •λ©λ‹ˆλ‹€(1.7.12). 기본적으둜 purger_thresholdλŠ” 50λ°€λ¦¬μ΄ˆλ‘œ μ„€μ •λ©λ‹ˆλ‹€.

purger_sleep=number

반볡 μ‚¬μ΄μ˜ μΌμ‹œ 쀑지λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€(1.7.12). 기본적으둜 purger_sleep은 50λ°€λ¦¬μ΄ˆλ‘œ μ„€μ •λ©λ‹ˆλ‹€.

버전 1.7.3, 1.7.7 및 1.11.10μ—μ„œ μΊμ‹œ 헀더 ν˜•μ‹μ΄ λ³€κ²½λ˜μ—ˆμŠ΅λ‹ˆλ‹€. 이전에 μΊμ‹œλœ 응닡은 μ΅œμ‹  nginx λ²„μ „μœΌλ‘œ μ—…κ·Έλ ˆμ΄λ“œ 후에 잘λͺ»λœ κ²ƒμœΌλ‘œ κ°„μ£Όλ©λ‹ˆλ‹€.

Syntax:  uwsgi_cache_purge string ...;
Default: β€”
Context: http, server, location
This directive appeared in version 1.5.7.

μš”μ²­μ΄ μΊμ‹œ 제거 μš”μ²­μœΌλ‘œ κ°„μ£Όλ˜λŠ” 쑰건을 μ •μ˜ν•©λ‹ˆλ‹€. λ¬Έμžμ—΄ λ§€κ°œλ³€μˆ˜μ˜ ν•˜λ‚˜ μ΄μƒμ˜ 값이 λΉ„μ–΄ μžˆμ§€ μ•Šκ³  “0”κ³Ό κ°™μ§€ μ•ŠμœΌλ©΄ ν•΄λ‹Ήν•˜λŠ” μΊμ‹œ ν‚€κ°€ μžˆλŠ” μΊμ‹œ ν•­λͺ©μ΄ μ œκ±°λ©λ‹ˆλ‹€. 성곡적인 μž‘μ—…μ˜ κ²°κ³ΌλŠ” 204(μ½˜ν…μΈ  μ—†μŒ) 응닡을 λ°˜ν™˜ν•˜μ—¬ ν‘œμ‹œλ©λ‹ˆλ‹€.

제거 μš”μ²­μ˜ μΊμ‹œ ν‚€κ°€ λ³„ν‘œ(“*”)둜 λλ‚˜λŠ” 경우 μ™€μΌλ“œ μΉ΄λ“œ 킀와 μΌμΉ˜ν•˜λŠ” λͺ¨λ“  μΊμ‹œ ν•­λͺ©μ΄ μΊμ‹œμ—μ„œ μ œκ±°λ©λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ μ΄λŸ¬ν•œ ν•­λͺ©μ€ λΉ„ν™œμ„±μ„ μœ„ν•΄ μ‚­μ œλ˜κ±°λ‚˜ μΊμ‹œ 퍼저(1.7.12)에 μ˜ν•΄ μ²˜λ¦¬λ˜κ±°λ‚˜ ν΄λΌμ΄μ–ΈνŠΈκ°€ ν•­λͺ©μ— μ•‘μ„ΈμŠ€λ₯Ό μ‹œλ„ν•  λ•ŒκΉŒμ§€ λ””μŠ€ν¬μ— λ‚¨μŠ΅λ‹ˆλ‹€.

예제 ꡬ성:

uwsgi_cache_path /data/nginx/cache keys_zone=cache_zone:10m;

map $request_method $purge_method {
    PURGE   1;
    default 0;
}

server {
    ...
    location / {
        uwsgi_pass        backend;
        uwsgi_cache       cache_zone;
        uwsgi_cache_key   $uri;
        uwsgi_cache_purge $purge_method;
    }
}

이 κΈ°λŠ₯은 μƒμ—…μš© κ΅¬λ…μ˜ μΌλΆ€λ‘œ μ‚¬μš© κ°€λŠ₯ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_cache_revalidate on | off;
Default: uwsgi_cache_revalidate off;
Context: http, server, location
This directive appeared in version 1.5.7.

“If-Modified-Since” 및 “If-None-Match” 헀더 ν•„λ“œλ₯Ό ν¬ν•¨ν•˜λŠ” 쑰건뢀 μš”μ²­μ„ μ‚¬μš©ν•˜μ—¬ 만료된 μΊμ‹œ ν•­λͺ©μ˜ μž¬κ²€μ¦μ„ ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_cache_use_stale error | timeout | invalid_header | updating | http_500 | http_503 | http_403 | 
         http_404 | http_429 | off ...;
Default: uwsgi_cache_use_stale off;
Context: http, server, location

uwsgi μ„œλ²„μ™€ ν†΅μ‹ ν•˜λŠ” λ™μ•ˆ 였λ₯˜κ°€ λ°œμƒν•  λ•Œ 였래된 μΊμ‹œλœ 응닡을 μ‚¬μš©ν•  수 μžˆλŠ” 경우λ₯Ό κ²°μ •ν•©λ‹ˆλ‹€. λͺ…λ Ήμ˜ λ§€κ°œλ³€μˆ˜λŠ” uwsgi_next_upstream λͺ…λ Ήμ˜ λ§€κ°œλ³€μˆ˜μ™€ μΌμΉ˜ν•©λ‹ˆλ‹€.

error λ§€κ°œλ³€μˆ˜λ„ μš”μ²­μ„ μ²˜λ¦¬ν•˜λŠ” uwsgi μ„œλ²„λ₯Ό 선택할 수 μ—†λŠ” 경우 였래된 μΊμ‹œλœ μ‘λ‹΅μ˜ μ‚¬μš©μ„ ν—ˆμš©ν•©λ‹ˆλ‹€.

λ˜ν•œ, updating λ§€κ°œλ³€μˆ˜λŠ” ν˜„μž¬ μ—…λ°μ΄νŠΈλ˜κ³  μžˆλŠ” 경우 였래된 μΊμ‹œλœ μ‘λ‹΅μ˜ μ‚¬μš©μ„ ν—ˆμš©ν•©λ‹ˆλ‹€. 이에 따라 μΊμ‹œλœ 데이터λ₯Ό μ—…λ°μ΄νŠΈν•  λ•Œ uwsgi μ„œλ²„μ— λŒ€ν•œ μ•‘μ„ΈμŠ€ μˆ˜κ°€ μ΅œμ†Œν™”λ  수 μžˆμŠ΅λ‹ˆλ‹€.

였래된 μΊμ‹œλœ μ‘λ‹΅μ˜ μ‚¬μš©μ€ 응닡이 였래된 ν›„(1.11.10) μ§€μ •λœ 초 수 λ™μ•ˆ 응닡 ν—€λ”μ—μ„œ 직접 ν™œμ„±ν™”ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€. 이 방식은 λͺ…λ Ή λ§€κ°œλ³€μˆ˜ μ‚¬μš©λ³΄λ‹€ μš°μ„ μˆœμœ„κ°€ λ–¨μ–΄μ§‘λ‹ˆλ‹€.

  • “Cache-Control” 헀더 ν•„λ“œμ˜ “stale-while-revalidate” ν™•μž₯은 ν˜„μž¬ μ—…λ°μ΄νŠΈλ˜κ³  μžˆλŠ” 경우 였래된 μΊμ‹œλœ μ‘λ‹΅μ˜ μ‚¬μš©μ„ ν—ˆμš©ν•©λ‹ˆλ‹€.
  • “Cache-Control” 헀더 ν•„λ“œμ˜ “stale-if-error” ν™•μž₯은 였λ₯˜ λ°œμƒ μ‹œ 였래된 μΊμ‹œλœ μ‘λ‹΅μ˜ μ‚¬μš©μ„ ν—ˆμš©ν•©λ‹ˆλ‹€.

μƒˆλ‘œμš΄ μΊμ‹œ μš”μ†Œλ₯Ό μ±„μšΈ λ•Œ uwsgi μ„œλ²„μ— λŒ€ν•œ μ•‘μ„ΈμŠ€ 수λ₯Ό μ΅œμ†Œν™”ν•˜λ €λ©΄ uwsgi_cache_lock λͺ…령을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_cache_valid [code ...] time;
Default: β€”
Context: http, server, location

λ‹€λ₯Έ 응닡 μ½”λ“œμ— λŒ€ν•œ 캐싱 μ‹œκ°„μ„ μ„€μ •ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, λ‹€μŒ λͺ…령은

uwsgi_cache_valid 200 302 10m;
uwsgi_cache_valid 404      1m;

μ½”λ“œ 200 및 302κ°€ ν¬ν•¨λœ 응닡에 λŒ€ν•΄ 10λΆ„μ˜ 캐싱을 μ„€μ •ν•˜κ³  μ½”λ“œ 404κ°€ ν¬ν•¨λœ 응닡에 λŒ€ν•΄ 1λΆ„μ˜ 캐싱을 μ„€μ •ν•©λ‹ˆλ‹€.

캐싱 μ‹œκ°„λ§Œ μ§€μ •λœ 경우

uwsgi_cache_valid 5m;

200, 301, 302 μ‘λ‹΅λ§Œ μΊμ‹œλ©λ‹ˆλ‹€.

λ˜ν•œ any λ§€κ°œλ³€μˆ˜λŠ” λͺ¨λ“  응닡을 μΊμ‹œν•˜κΈ° μœ„ν•΄ μ§€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

uwsgi_cache_valid 200 302 10m;
uwsgi_cache_valid 301      1h;
uwsgi_cache_valid any      1m;

μΊμ‹±μ˜ λ§€κ°œλ³€μˆ˜λŠ” 응닡 ν—€λ”μ—μ„œ 직접 μ„€μ •ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€. 이 방식은 λͺ…령을 μ‚¬μš©ν•œ 캐싱 μ‹œκ°„ 섀정보닀 μš°μ„ μˆœμœ„κ°€ λ†’μŠ΅λ‹ˆλ‹€.

  • “X-Accel-Expires” 헀더 ν•„λ“œλŠ” μ‘λ‹΅μ˜ 캐싱 μ‹œκ°„μ„ 초 λ‹¨μœ„λ‘œ μ„€μ •ν•©λ‹ˆλ‹€. 0 값은 응닡에 λŒ€ν•œ 캐싱을 λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€. 값이 @ μ ‘λ‘μ‚¬λ‘œ μ‹œμž‘ν•˜λŠ” 경우, Epochκ°€ μ‹œμž‘λ˜κ³  κ²½κ³Όν•œ μ ˆλŒ€ μ‹œκ°„(초)을 μ„€μ •ν•˜λ©΄ κ·Έ μ‹œκ°„κΉŒμ§€ 응닡을 캐싱할 수 μžˆμŠ΅λ‹ˆλ‹€.
  • 헀더에 “X-Accel-Expires” ν•„λ“œκ°€ ν¬ν•¨λ˜μ§€ μ•Šμ€ 경우 μΊμ‹±μ˜ λ§€κ°œλ³€μˆ˜λŠ” 헀더 ν•„λ“œ “Expires” λ˜λŠ” “Cache-Control”μ—μ„œ μ„€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
  • 헀더에 “Set-Cookie” ν•„λ“œκ°€ ν¬ν•¨λ˜λ©΄ κ·ΈλŸ¬ν•œ 응닡은 μΊμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
  • 헀더에 특수 κ°’ “*”와 ν•¨κ»˜ “Vary” ν•„λ“œκ°€ ν¬ν•¨λ˜λŠ” 경우 κ·ΈλŸ¬ν•œ 응닡은 μΊμ‹œλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€(1.7.7). 헀더에 λ‹€λ₯Έ κ°’κ³Ό ν•¨κ»˜ “Vary” ν•„λ“œκ°€ ν¬ν•¨λœ 경우 κ·ΈλŸ¬ν•œ 응닡은 ν•΄λ‹Ήν•˜λŠ” μš”μ²­ 헀더 ν•„λ“œλ₯Ό κ³ λ €ν•˜μ—¬ μΊμ‹œλ©λ‹ˆλ‹€(1.7.7).

ν•˜λ‚˜ μ΄μƒμ˜ μ΄λŸ¬ν•œ 응닡 헀더 ν•„λ“œμ˜ μ²˜λ¦¬λŠ” uwsgi_ignore_headers λͺ…령을 μ‚¬μš©ν•˜μ—¬ λΉ„ν™œμ„±ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_connect_timeout time;
Default: uwsgi_connect_timeout 60s;
Context: http, server, location

uwsgi μ„œλ²„μ™€μ˜ 연결을 μ„€μ •ν•˜κΈ° μœ„ν•œ μ‹œκ°„μ œν•œμ„ μ •μ˜ν•©λ‹ˆλ‹€. 이 μ‹œκ°„μ œν•œμ€ 일반적으둜 75초λ₯Ό μ΄ˆκ³Όν•  수 μ—†λ‹€λŠ” 점을 μœ λ…ν•΄μ•Ό ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_force_ranges on | off;
Default: uwsgi_force_ranges off;
Context: http, server, location
This directive appeared in version 1.7.7.

μ΄λŸ¬ν•œ μ‘λ‹΅μ˜ “Accept-Ranges” ν•„λ“œμ™€ 관계없이 uwsgi μ„œλ²„λ‘œλΆ€ν„°μ˜ μΊμ‹œλœ 응닡과 μΊμ‹œλ˜μ§€ μ•Šμ€ 응닡 λͺ¨λ‘μ— λŒ€ν•΄ λ°”μ΄νŠΈ λ²”μœ„ 지원을 ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_hide_header field;
Default: β€”
Context: http, server, location

기본적으둜 nginxλŠ” uwsgi μ„œλ²„μ˜ μ‘λ‹΅μ—μ„œ ν΄λΌμ΄μ–ΈνŠΈλ‘œ 헀더 ν•„λ“œ “Status” 및 “X-Accel-…”을 μ „λ‹¬ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. uwsgi_hide_header λͺ…령은 μ „λ‹¬λ˜μ§€ μ•ŠλŠ” μΆ”κ°€ ν•„λ“œλ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. λ°˜λŒ€λ‘œ ν•„λ“œ 전달을 ν—ˆμš©ν•΄μ•Ό ν•˜λŠ” 경우 uwsgi_pass_header λͺ…령을 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_ignore_client_abort on | off;
Default: uwsgi_ignore_client_abort off;
Context: http, server, location

ν΄λΌμ΄μ–ΈνŠΈκ°€ 응닡을 기닀리지 μ•Šκ³  연결을 닫을 λ•Œ uwsgi μ„œλ²„μ™€μ˜ 연결이 λ‹«ν˜€μ•Ό ν•˜λŠ”μ§€λ₯Ό κ²°μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_ignore_headers field ...;
Default: β€”
Context: http, server, location

uwsgi μ„œλ²„μ˜ νŠΉμ •ν•œ 응닡 헀더 ν•„λ“œ 처리λ₯Ό λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€. λ‹€μŒ ν•„λ“œλŠ” λ¬΄μ‹œν•  수 μžˆμŠ΅λ‹ˆλ‹€. “X-Accel-Redirect”, “X-Accel-Expires”, “X-Accel-Limit-Rate”(1.1.6), “X-Accel-Buffering”(1.1.6), “X-Accel-Charset”(1.1.6), “Expires”, “Cache-Control”, “Set-Cookie”(0.8.44) 및 “Vary”(1.7.7).

λΉ„ν™œμ„±ν™”λ˜μ§€ μ•ŠμœΌλ©΄ μ΄λŸ¬ν•œ 헀더 ν•„λ“œλ₯Ό μ²˜λ¦¬ν•  경우 λ‹€μŒκ³Ό 같은 νš¨κ³Όκ°€ μžˆμŠ΅λ‹ˆλ‹€.

  • “X-Accel-Expires”, “Expires”, “Cache-Control”, “Set-Cookie” 및 “Vary”λŠ” 응닡 μΊμ‹±μ˜ λ§€κ°œλ³€μˆ˜λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.
  • “X-Accel-Redirect”λŠ” μ§€μ •λœ URI에 λŒ€ν•œ λ‚΄λΆ€ λ¦¬λ””λ ‰μ…˜μ„ μˆ˜ν–‰ν•©λ‹ˆλ‹€.
  • “X-Accel-Limit-Rate”λŠ” ν΄λΌμ΄μ–ΈνŠΈμ— λŒ€ν•œ 응닡 전솑을 μœ„ν•΄ 속도 μ œν•œμ„ μ„€μ •ν•©λ‹ˆλ‹€.
  • “X-Accel-Buffering”은 μ‘λ‹΅μ˜ 버퍼링을 ν™œμ„±ν™”ν•˜κ±°λ‚˜ λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€.
  • “X-Accel-Charset”은 μ‘λ‹΅μ˜ μ›ν•˜λŠ” charset을 μ„€μ •ν•©λ‹ˆλ‹€.
Syntax:  uwsgi_intercept_errors on | off;
Default: uwsgi_intercept_errors off;
Context: http, server, location

μ½”λ“œκ°€ 300보닀 ν¬κ±°λ‚˜ 같은 uwsgi μ„œλ²„ 응닡이 ν΄λΌμ΄μ–ΈνŠΈμ— μ „λ‹¬λ˜μ–΄μ•Ό ν•˜λŠ”μ§€ μ•„λ‹ˆλ©΄ error_page λͺ…λ ΉμœΌλ‘œ μ²˜λ¦¬ν•˜κΈ° μœ„ν•΄ κ°€λ‘œμ±„μ„œ nginx둜 λ¦¬λ””λ ‰μ…˜ν•΄μ•Ό ν•˜λŠ”μ§€ κ²°μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_limit_rate rate;
Default: uwsgi_limit_rate 0;
Context: http, server, location
This directive appeared in version 1.7.7.

uwsgi μ„œλ²„μ—μ„œμ˜ 응닡을 μ½λŠ” 속도λ₯Ό μ œν•œν•©λ‹ˆλ‹€. μ†λ„λŠ” μ΄ˆλ‹Ή λ°”μ΄νŠΈλ‘œ μ§€μ •λ©λ‹ˆλ‹€. 0 값은 속도 μ œν•œμ„ λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€. μ œν•œμ€ μš”μ²­λ‹Ή μ„€μ •λ˜λ―€λ‘œ nginxκ°€ uwsgi μ„œλ²„μ— λŒ€ν•œ 2개의 연결을 λ™μ‹œμ— μ—° 경우 전체 μ†λ„λŠ” μ§€μ •λœ μ†λ„μ˜ 2λ°°μž…λ‹ˆλ‹€. μ œν•œμ€ uwsgi μ„œλ²„μ—μ„œμ˜ 응닡 버퍼링이 ν™œμ„±ν™”λœ κ²½μš°μ—λ§Œ μž‘λ™ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_max_temp_file_size size;
Default: uwsgi_max_temp_file_size 1024m;
Context: http, server, location

uwsgi μ„œλ²„μ—μ„œμ˜ 응닡 버퍼링이 ν™œμ„±ν™”λ˜κ³  전체 응닡이 uwsgi_buffer_size 및 uwsgi_buffers λͺ…λ ΉμœΌλ‘œ μ„€μ •λœ 버퍼에 λ§žμ§€ μ•ŠμœΌλ©΄ μ‘λ‹΅μ˜ 일뢀가 μž„μ‹œ 파일둜 μ €μž₯될 수 μžˆμŠ΅λ‹ˆλ‹€. 이 λͺ…령은 μž„μ‹œ 파일의 μ΅œλŒ€ 크기λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. ν•œ λ²ˆμ— μž„μ‹œ νŒŒμΌμ— κΈ°λ‘λ˜λŠ” λ°μ΄ν„°μ˜ ν¬κΈ°λŠ” uwsgi_temp_file_write_size λͺ…λ ΉμœΌλ‘œ μ„€μ •λ©λ‹ˆλ‹€.

0 값은 μž„μ‹œ νŒŒμΌμ— λŒ€ν•œ μ‘λ‹΅μ˜ 버퍼링을 λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

이 μ œν•œμ€ μΊμ‹œλ˜κ±°λ‚˜ λ””μŠ€ν¬μ— μ €μž₯될 μ‘λ‹΅μ—λŠ” μ μš©λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_modifier1 number;
Default: uwsgi_modifier1 0;
Context: http, server, location

uwsgi packet headerμ—μ„œ modifier1 ν•„λ“œμ˜ 값을 μ„€μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_modifier2 number;
Default: uwsgi_modifier2 0;
Context: http, server, location

uwsgi packet headerμ—μ„œ modifier2 ν•„λ“œμ˜ 값을 μ„€μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_next_upstream error | timeout | invalid_header | http_500 | http_503 | http_403 | http_404 | 
         http_429 | non_idempotent | off ...;
Default: uwsgi_next_upstream error timeout;
Context: http, server, location

μš”μ²­μ΄ λ‹€μŒ μ„œλ²„μ— μ „λ‹¬λ˜μ–΄μ•Ό ν•˜λŠ” 경우λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€.

error

μ„œλ²„μ™€μ˜ 연결을 μ„€μ •ν•˜κ³  μš”μ²­μ„ μ„œλ²„μ— μ „λ‹¬ν•˜κ±°λ‚˜ 응닡 헀더λ₯Ό μ½λŠ” λ™μ•ˆ 였λ₯˜ λ°œμƒ

timeout

μ„œλ²„μ™€μ˜ 연결을 μ„€μ •ν•˜κ³  μš”μ²­μ„ μ„œλ²„μ— μ „λ‹¬ν•˜κ±°λ‚˜ 응닡 헀더λ₯Ό μ½λŠ” λ™μ•ˆ μ‹œκ°„μ œν•œ λ°œμƒ

invalid_header

μ„œλ²„κ°€ λΉ„μ–΄ μžˆκ±°λ‚˜ 잘λͺ»λœ 응닡을 λ°˜ν™˜ν–ˆμŠ΅λ‹ˆλ‹€.

http_500

μ„œλ²„κ°€ μ½”λ“œ 500으둜 응닡을 λ°˜ν™˜ν–ˆμŠ΅λ‹ˆλ‹€.

http_503

μ„œλ²„κ°€ μ½”λ“œ 503으둜 응닡을 λ°˜ν™˜ν–ˆμŠ΅λ‹ˆλ‹€.

http_403

μ„œλ²„κ°€ μ½”λ“œ 403으둜 응닡을 λ°˜ν™˜ν–ˆμŠ΅λ‹ˆλ‹€.

http_404

μ„œλ²„κ°€ μ½”λ“œ 404둜 응닡을 λ°˜ν™˜ν–ˆμŠ΅λ‹ˆλ‹€.

http_429

μ„œλ²„κ°€ μ½”λ“œ 429(1.11.13)둜 응닡을 λ°˜ν™˜ν–ˆμŠ΅λ‹ˆλ‹€.

non_idempotent

일반적으둜 non-idempotent λ©”μ„œλ“œ(POST, LOCK, PATCH)λ₯Ό ν¬ν•¨ν•˜λŠ” μš”μ²­μ€ μš”μ²­μ΄ μ—…μŠ€νŠΈλ¦Ό μ„œλ²„(1.9.13)둜 μ „μ†‘λœ 경우 λ‹€μŒ μ„œλ²„μ— μ „λ‹¬λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. 이 μ˜΅μ…˜μ„ ν™œμ„±ν™”ν•˜λ©΄ κ·ΈλŸ¬ν•œ μš”μ²­μ˜ μž¬μ‹œλ„κ°€ λͺ…μ‹œμ μœΌλ‘œ ν—ˆμš©λ©λ‹ˆλ‹€.

off

λ‹€μŒ μ„œλ²„λ‘œμ˜ μš”μ²­ 전달이 λΉ„ν™œμ„±ν™”λ©λ‹ˆλ‹€.

λ‹€μŒ μ„œλ²„λ‘œμ˜ μš”μ²­ 전달은 아직 ν΄λΌμ΄μ–ΈνŠΈμ— 아무것도 μ „μ†‘λ˜μ§€ μ•Šμ€ κ²½μš°μ—λ§Œ κ°€λŠ₯ν•©λ‹ˆλ‹€. 즉, 응닡 전솑 쀑에 였λ₯˜ λ˜λŠ” μ‹œκ°„μ œν•œμ΄ λ°œμƒν•˜λŠ” 경우 이λ₯Ό μˆ˜μ •ν•˜λŠ” 것은 λΆˆκ°€λŠ₯ν•©λ‹ˆλ‹€.

λͺ…령은 λ˜ν•œ μ„œλ²„μ™€μ˜ ν†΅μ‹ μ˜ μ‹€νŒ¨ν•œ μ‹œλ„λ‘œ κ°„μ£Όλ˜λŠ” 것도 μ •μ˜ν•©λ‹ˆλ‹€. error, timeout 및 invalid_headerλŠ” λͺ…령에 μ§€μ •λ˜μ§€ μ•Šλ”λΌλ„ 항상 μ‹€νŒ¨ν•œ μ‹œλ„λ‘œ κ°„μ£Όλ©λ‹ˆλ‹€. http_500, http_503 및 http_429의 κ²½μš°λŠ” λͺ…령에 μ§€μ •λœ κ²½μš°μ—λ§Œ μ‹€νŒ¨ν•œ μ‹œλ„λ‘œ κ°„μ£Όλ©λ‹ˆλ‹€. http_403 및 http_404의 κ²½μš°λŠ” μ ˆλŒ€ μ‹€νŒ¨ν•œ μ‹œλ„λ‘œ κ°„μ£Όλ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

μš”μ²­μ„ λ‹€μŒ μ„œλ²„λ‘œ μ „λ‹¬ν•˜λŠ” 것은 μ‹œλ„ 수 및 μ‹œκ°„μ— μ˜ν•΄ μ œν•œλ  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_next_upstream_timeout time;
Default: uwsgi_next_upstream_timeout 0;
Context: http, server, location
This directive appeared in version 1.7.5.

μš”μ²­μ„ λ‹€μŒ μ„œλ²„λ‘œ 전달할 수 μžˆλŠ” 기간을 μ œν•œν•©λ‹ˆλ‹€. 0 값은 이 μ œν•œμ„ ν•΄μ œν•©λ‹ˆλ‹€.

Syntax:  uwsgi_next_upstream_tries number;
Default: uwsgi_next_upstream_tries 0;
Context: http, server, location
This directive appeared in version 1.7.5.

μš”μ²­μ„ λ‹€μŒ μ„œλ²„λ‘œ 전달할 수 μžˆλŠ” κ°€λŠ₯ν•œ μ‹œλ„ 수λ₯Ό μ œν•œν•©λ‹ˆλ‹€. 0 값은 이 μ œν•œμ„ ν•΄μ œν•©λ‹ˆλ‹€.

Syntax:  uwsgi_no_cache string ...;
Default: β€”
Context: http, server, location

응닡이 μΊμ‹œμ— μ €μž₯λ˜μ§€ μ•ŠλŠ” 쑰건을 μ •μ˜ν•©λ‹ˆλ‹€. λ¬Έμžμ—΄ λ§€κ°œλ³€μˆ˜μ˜ ν•˜λ‚˜ μ΄μƒμ˜ 값이 λΉ„μ–΄ μžˆμ§€ μ•Šκ³  “0”κ³Ό κ°™μ§€ μ•ŠμœΌλ©΄ 응닡이 μ €μž₯λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

uwsgi_no_cache $cookie_nocache $arg_nocache$arg_comment;
uwsgi_no_cache $http_pragma    $http_authorization;

uwsgi_cache_bypass λͺ…λ Ήκ³Ό ν•¨κ»˜ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_param parameter value [if_not_empty];
Default: β€”
Context: http, server, location

uwsgi μ„œλ²„λ‘œ 전달해야 ν•˜λŠ” λ§€κ°œλ³€μˆ˜λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. 값은 ν…μŠ€νŠΈ, λ³€μˆ˜ 및 κ·Έ 쑰합을 포함할 수 μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ λͺ…령은 ν˜„μž¬ μˆ˜μ€€μ—μ„œ μ •μ˜λœ uwsgi_param λͺ…령이 μ—†λŠ” κ²½μš°μ—λ§Œ 이전 ꡬ성 μˆ˜μ€€μ—μ„œ μƒμ†λ©λ‹ˆλ‹€.

ν‘œμ€€ CGI ν™˜κ²½ λ³€μˆ˜λŠ” uwsgi ν—€λ”λ‘œ μ œκ³΅λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€. λ°°ν¬νŒμ— 제곡된 uwsgi_params νŒŒμΌμ„ μ°Έμ‘°ν•˜μ„Έμš”.

location / {
    include uwsgi_params;
    ...
}

λͺ…령이 if_not_empty(1.1.11)둜 μ§€μ •λœ 경우 κ·ΈλŸ¬ν•œ λ§€κ°œλ³€μˆ˜λŠ” ν•΄λ‹Ή 값이 λΉ„μ–΄ μžˆμ§€ μ•Šμ€ κ²½μš°μ—λ§Œ μ„œλ²„λ‘œ μ „λ‹¬λ©λ‹ˆλ‹€.

uwsgi_param HTTPS $https if_not_empty;
Syntax:  uwsgi_pass [protocol://]address;
Default: β€”
Context: location, if in location

uwsgi μ„œλ²„μ˜ ν”„λ‘œν† μ½œ 및 μ£Όμ†Œλ₯Ό μ„€μ •ν•©λ‹ˆλ‹€. ν”„λ‘œν† μ½œλ‘œ “uwsgi” λ˜λŠ” “suwsgi”(λ³΄μ•ˆ uwsgi, uwsgi over SSL)λ₯Ό μ§€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μ£Όμ†ŒλŠ” 도메인 이름 λ˜λŠ” IP μ£Όμ†Œ 및 포트둜 μ§€μ •ν•˜κ±°λ‚˜

uwsgi_pass localhost:9000;
uwsgi_pass uwsgi://localhost:9000;
uwsgi_pass suwsgi://[2001:db8::1]:9090;

λ˜λŠ” UNIX-도메인 μ†ŒμΌ“ 경둜둜 μ§€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

uwsgi_pass unix:/tmp/uwsgi.socket;

도메인 이름이 μ—¬λŸ¬ μ£Όμ†Œλ‘œ ν™•μΈλ˜λ©΄ ν•΄λ‹Ήν•˜λŠ” λͺ¨λ“  μ£Όμ†ŒλŠ” λΌμš΄λ“œ 둜빈 λ°©μ‹μœΌλ‘œ μ‚¬μš©λ©λ‹ˆλ‹€. λ˜ν•œ, μ£Όμ†ŒλŠ” μ„œλ²„ 그룹으둜 μ§€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ§€κ°œλ³€μˆ˜ κ°’μ—λŠ” λ³€μˆ˜κ°€ 포함될 수 μžˆμŠ΅λ‹ˆλ‹€. 이 경우 μ£Όμ†Œκ°€ 도메인 μ΄λ¦„μœΌλ‘œ μ§€μ •λ˜λ©΄ 이름은 μ„€λͺ…λœ μ„œλ²„ κ·Έλ£Ή μ€‘μ—μ„œ κ²€μƒ‰λ˜κ³  μ—†λŠ” 경우 ν™•μΈμžλ₯Ό μ‚¬μš©ν•˜μ—¬ κ²°μ •λ©λ‹ˆλ‹€.

λ³΄μ•ˆ uwsgi ν”„λ‘œν† μ½œμ€ 버전 1.5.8 이후 μ§€μ›λ©λ‹ˆλ‹€.

Syntax:  uwsgi_pass_header field;
Default: β€”
Context: http, server, location

uwsgi μ„œλ²„μ—μ„œ ν΄λΌμ΄μ–ΈνŠΈλ‘œ λ‹€λ₯Έ λ°©μ‹μœΌλ‘œ λΉ„ν™œμ„±ν™”λœ 헀더 ν•„λ“œμ˜ 전달을 ν—ˆμš©ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_pass_request_body on | off;
Default: uwsgi_pass_request_body on;
Context: http, server, location

μ›λž˜ μš”μ²­ 본문이 uwsgi μ„œλ²„λ‘œ μ „λ‹¬λ˜λŠ”μ§€λ₯Ό λ‚˜νƒ€λƒ…λ‹ˆλ‹€. uwsgi_pass_request_headers λͺ…령도 μ°Έμ‘°ν•˜μ„Έμš”.

Syntax:  uwsgi_pass_request_headers on | off;
Default: uwsgi_pass_request_headers on;
Context: http, server, location

μ›λž˜ μš”μ²­μ˜ 헀더 ν•„λ“œκ°€ uwsgi μ„œλ²„λ‘œ μ „λ‹¬λ˜λŠ”μ§€ λ‚˜νƒ€λƒ…λ‹ˆλ‹€. uwsgi_pass_request_body λͺ…령도 μ°Έμ‘°ν•˜μ„Έμš”.

Syntax:  uwsgi_read_timeout time;
Default: uwsgi_read_timeout 60s;
Context: http, server, location

uwsgi μ„œλ²„μ—μ„œ 응닡을 읽기 μœ„ν•œ μ‹œκ°„μ œν•œμ„ μ •μ˜ν•©λ‹ˆλ‹€. μ‹œκ°„μ œν•œμ€ 전체 μ‘λ‹΅μ˜ 전솑에 λŒ€ν•΄μ„œκ°€ μ•„λ‹ˆλΌ 2개의 연속적인 읽기 μž‘μ—… μ‚¬μ΄μ—μ„œλ§Œ μ„€μ •λ©λ‹ˆλ‹€. uwsgi μ„œλ²„κ°€ 이 μ‹œκ°„ 내에 아무것도 μ „μ†‘ν•˜μ§€ μ•ŠμœΌλ©΄ 연결이 λ‹«νž™λ‹ˆλ‹€.

Syntax:  uwsgi_request_buffering on | off;
Default: uwsgi_request_buffering on;
Context: http, server, location
This directive appeared in version 1.7.11.

ν΄λΌμ΄μ–ΈνŠΈ μš”μ²­ 본문의 버퍼링을 ν™œμ„±ν™”ν•˜κ±°λ‚˜ λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

버퍼링이 ν™œμ„±ν™”λ˜λ©΄ μš”μ²­μ„ uwsgi μ„œλ²„μ— 보내기 전에 전체 μš”μ²­ 본문이 ν΄λΌμ΄μ–ΈνŠΈμ—μ„œ μ½νž™λ‹ˆλ‹€.

버퍼링이 λΉ„ν™œμ„±ν™”λ˜λ©΄ μš”μ²­ 본문이 μˆ˜μ‹ λ˜μžλ§ˆμž μ¦‰μ‹œ uwsgi μ„œλ²„λ‘œ μ „μ†‘λ©λ‹ˆλ‹€. 이 경우 μš”μ²­μ€ nginxκ°€ 이미 μš”μ²­ 본문의 전솑을 μ‹œμž‘ν•œ 경우 λ‹€μŒ μ„œλ²„λ‘œ 전달될 수 μ—†μŠ΅λ‹ˆλ‹€.

HTTP/1.1 청크 λΆ„ν•  전솑 인코딩이 μ›λž˜ μš”μ²­ 본문을 μ „μ†‘ν•˜λŠ” 데 μ‚¬μš©λ˜λ©΄ μš”μ²­ 본문은 λͺ…λ Ή κ°’κ³Ό 관계없이 λ²„νΌλ§λ©λ‹ˆλ‹€.

Syntax:  uwsgi_send_timeout time;
Default: uwsgi_send_timeout 60s;
Context: http, server, location

μš”μ²­μ„ uwsgi μ„œλ²„λ‘œ μ „μ†‘ν•˜λŠ” 데 λŒ€ν•œ μ‹œκ°„μ œν•œμ„ μ„€μ •ν•©λ‹ˆλ‹€. μ‹œκ°„μ œν•œμ€ 전체 μš”μ²­μ˜ 전솑에 λŒ€ν•΄μ„œκ°€ μ•„λ‹ˆλΌ 2개의 연속적인 μ“°κΈ° μž‘μ—… μ‚¬μ΄μ—μ„œλ§Œ μ„€μ •λ©λ‹ˆλ‹€. uwsgi μ„œλ²„κ°€ 이 μ‹œκ°„ 내에 아무것도 μˆ˜μ‹ ν•˜μ§€ μ•ŠμœΌλ©΄ 연결이 λ‹«νž™λ‹ˆλ‹€.

Syntax:  uwsgi_socket_keepalive on | off;
Default: uwsgi_socket_keepalive off;
Context: http, server, location
This directive appeared in version 1.15.6.

uwsgi μ„œλ²„λ‘œ λ‚˜κ°€λŠ” 연결에 λŒ€ν•œ “TCP keepalive” λ™μž‘μ„ κ΅¬μ„±ν•©λ‹ˆλ‹€. 기본적으둜 운영 체제의 섀정은 μ†ŒμΌ“μ— λŒ€ν•΄ μœ νš¨ν•©λ‹ˆλ‹€. λͺ…λ Ήμ—μ„œ “on” 값을 μ„€μ •ν•˜λ©΄ ν•΄λ‹Ή μ†ŒμΌ“μ— λŒ€ν•΄ SO_KEEPALIVE μ˜΅μ…˜μ΄ ν™œμ„±ν™”λ©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_certificate file;
Default: β€”
Context: http, server, location
This directive appeared in version 1.7.8.

λ³΄μ•ˆ uwsgi μ„œλ²„μ— λŒ€ν•œ 인증에 μ‚¬μš©λœ PEM ν˜•μ‹μ˜ μΈμ¦μ„œλ‘œ νŒŒμΌμ„ μ§€μ •ν•©λ‹ˆλ‹€.

버전 1.21.0 이후 λ³€μˆ˜λ₯Ό 파일 이름에 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_certificate_key file;
Default: β€”
Context: http, server, location
This directive appeared in version 1.7.8.

λ³΄μ•ˆ uwsgi μ„œλ²„μ— λŒ€ν•œ 인증에 μ‚¬μš©λœ PEM ν˜•μ‹μ˜ λΉ„λ°€ ν‚€λ‘œ νŒŒμΌμ„ μ§€μ •ν•©λ‹ˆλ‹€.

κ°’ engine:name:idλŠ” 파일(1.7.9) λŒ€μ‹  지정될 수 있고 이것은 OpenSSL engine μ΄λ¦„μ—μ„œ μ§€μ •λœ id둜 λΉ„λ°€ ν‚€λ₯Ό λ‘œλ“œν•©λ‹ˆλ‹€.

버전 1.21.0 이후 λ³€μˆ˜λ₯Ό 파일 이름에 μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_ciphers ciphers;
Default: uwsgi_ssl_ciphers DEFAULT;
Context: http, server, location
This directive appeared in version 1.5.8.

λ³΄μ•ˆ uwsgi μ„œλ²„μ— λŒ€ν•œ μš”μ²­μ— λŒ€ν•΄ ν™œμ„±ν™”λœ μ•”ν˜Έν™”λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€. μ•”ν˜Έν™”λŠ” OpenSSL λΌμ΄λΈŒλŸ¬λ¦¬κ°€ μ΄ν•΄ν•˜λŠ” ν˜•μ‹μœΌλ‘œ μ§€μ •λ©λ‹ˆλ‹€.

전체 λͺ©λ‘μ€ “openssl ciphers” λͺ…령을 μ‚¬μš©ν•˜μ—¬ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_conf_command command;
Default: β€”
Context: http, server, location
This directive appeared in version 1.19.4.

λ³΄μ•ˆ uwsgi μ„œλ²„μ™€μ˜ 연결을 μ„€μ •ν•  λ•Œ μž„μ˜μ˜ OpenSSL ꡬ성 λͺ…령을 μ„€μ •ν•©λ‹ˆλ‹€.

λͺ…령은 OpenSSL 1.0.2 이상을 μ‚¬μš©ν•˜λŠ” 경우 μ§€μ›λ©λ‹ˆλ‹€.

μ—¬λŸ¬ uwsgi_ssl_conf_command λͺ…령은 λ™μΌν•œ μˆ˜μ€€μ—μ„œ μ§€μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ λͺ…령은 ν˜„μž¬ μˆ˜μ€€μ— μ •μ˜λœ uwsgi_ssl_conf_command λͺ…령이 μ—†λŠ” κ²½μš°μ—λ§Œ 이전 ꡬ성 μˆ˜μ€€μ—μ„œ μƒμ†λ©λ‹ˆλ‹€.

OpenSSL을 직접 κ΅¬μ„±ν•˜λ©΄ 예기치 λͺ»ν•œ λ™μž‘μ΄ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_crl file;
Default: β€”
Context: http, server, location
This directive appeared in version 1.7.0.

λ³΄μ•ˆ uwsgi μ„œλ²„μ˜ μΈμ¦μ„œλ₯Ό ν™•μΈν•˜λŠ” 데 μ‚¬μš©λ˜λŠ” PEM ν˜•μ‹μœΌλ‘œ ν•΄μ§€λœ μΈμ¦μ„œ(CRL)λ₯Ό μ‚¬μš©ν•˜μ—¬ νŒŒμΌμ„ μ§€μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_name name;
Default: uwsgi_ssl_name host from uwsgi_pass;
Context: http, server, location
This directive appeared in version 1.7.0.

λ³΄μ•ˆ uwsgi μ„œλ²„μ˜ μΈμ¦μ„œλ₯Ό ν™•μΈν•˜κ³  λ³΄μ•ˆ uwsgi μ„œλ²„μ™€μ™€ 연결을 μ„€μ •ν•  λ•Œ SNI ν†΅κ³Όν•˜λŠ” 데 μ‚¬μš©λ˜λŠ” μ„œλ²„ μ΄λ¦„μ˜ μž¬μ •μ˜λ₯Ό ν—ˆμš©ν•©λ‹ˆλ‹€.

기본적으둜 uwsgi_pass의 호슀트 뢀뢄이 μ‚¬μš©λ©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_password_file file;
Default: β€”
Context: http, server, location
This directive appeared in version 1.7.8.

각 μ•”ν˜Έκ°€ λ³„λ„μ˜ 행에 μ§€μ •λœ λΉ„λ°€ 킀에 λŒ€ν•œ μ•”ν˜Έλ₯Ό μ‚¬μš©ν•˜μ—¬ νŒŒμΌμ„ μ§€μ •ν•©λ‹ˆλ‹€. μ•”ν˜ΈλŠ” 결과적으둜 ν‚€λ₯Ό λ‘œλ“œν•  λ•Œ μ‹œλ„λ©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_protocols [SSLv2] [SSLv3] [TLSv1] [TLSv1.1] [TLSv1.2] [TLSv1.3];
Default: uwsgi_ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
Context: http, server, location
This directive appeared in version 1.5.8.

λ³΄μ•ˆ uwsgi μ„œλ²„μ— λŒ€ν•œ μš”μ²­μ˜ μ§€μ •λœ ν”„λ‘œν† μ½œμ„ ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_server_name on | off;
Default: uwsgi_ssl_server_name off;
Context: http, server, location
This directive appeared in version 1.7.0.

λ³΄μ•ˆ uwsgi μ„œλ²„μ™€μ˜ 연결을 μ„€μ •ν•  λ•Œ μ„œλ²„ 이름이 TLS Server Name Indication ν™•μž₯(SNI, RFC 6066)을 ν†΅κ³Όν•˜λŠ” 것을 ν™œμ„±ν™”ν•˜κ±°λ‚˜ λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_session_reuse on | off;
Default: uwsgi_ssl_session_reuse on;
Context: http, server, location
This directive appeared in version 1.5.8.

λ³΄μ•ˆ uwsgi μ„œλ²„λ‘œ μž‘μ—…μ„ μˆ˜ν–‰ν•  λ•Œ SSL μ„Έμ…˜μ„ μž¬μ‚¬μš©ν•  수 μžˆλŠ”μ§€λ₯Ό κ²°μ •ν•©λ‹ˆλ‹€. λ‘œκ·Έμ— “SSL3_GET_FINISHED:digest check failed” 였λ₯˜κ°€ λ‚˜νƒ€λ‚  경우 μ„Έμ…˜ μž¬μ‚¬μš©μ„ λΉ„ν™œμ„±ν™”ν•΄λ³΄μ„Έμš”.

Syntax:  uwsgi_ssl_trusted_certificate file;
Default: β€”
Context: http, server, location
This directive appeared in version 1.7.0.

λ³΄μ•ˆ uwsgi μ„œλ²„μ˜ μΈμ¦μ„œλ₯Ό ν™•μΈν•˜λŠ” 데 μ‚¬μš©λ˜λŠ” PEM ν˜•μ‹μœΌλ‘œ μ‹ λ’°ν•  수 μžˆλŠ” CA μΈμ¦μ„œλ₯Ό μ‚¬μš©ν•˜μ—¬ νŒŒμΌμ„ μ§€μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_verify on | off;
Default: uwsgi_ssl_verify off;
Context: http, server, location
This directive appeared in version 1.7.0.

λ³΄μ•ˆ uwsgi μ„œλ²„ μΈμ¦μ„œμ˜ 확인을 ν™œμ„±ν™”ν•˜κ±°λ‚˜ λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_ssl_verify_depth number;
Default: uwsgi_ssl_verify_depth 1;
Context: http, server, location
This directive appeared in version 1.7.0.

λ³΄μ•ˆ uwsgi μ„œλ²„ μΈμ¦μ„œ 체인의 확인 깊이λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.

Syntax:  uwsgi_store on | off | string;
Default: uwsgi_store off;
Context: http, server, location

λ””μŠ€ν¬μ— 파일 μ €μž₯을 ν™œμ„±ν™”ν•©λ‹ˆλ‹€. on λ§€κ°œλ³€μˆ˜λŠ” λͺ…λ Ή 별칭 λ˜λŠ” λ£¨νŠΈμ— ν•΄λ‹Ήν•˜λŠ” 경둜둜 νŒŒμΌμ„ μ €μž₯ν•©λ‹ˆλ‹€. off λ§€κ°œλ³€μˆ˜λŠ” 파일 μ €μž₯을 λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€. λ˜ν•œ, 파일 이름이 λ³€μˆ˜λ₯Ό ν¬ν•¨ν•˜λŠ” λ¬Έμžμ—΄μ„ μ‚¬μš©ν•˜μ—¬ λͺ…μ‹œμ μœΌλ‘œ 섀정될 수 μžˆμŠ΅λ‹ˆλ‹€.

uwsgi_store /data/www$original_uri;

파일의 μˆ˜μ • μ‹œκ°„μ€ μˆ˜μ‹ λœ “Last-Modified” 응닡 헀더 ν•„λ“œμ— 따라 μ„€μ •λ©λ‹ˆλ‹€. 응닡이 λ¨Όμ € μž„μ‹œ νŒŒμΌμ— 기둝된 λ‹€μŒ 파일 이름이 λ³€κ²½λ©λ‹ˆλ‹€. 버전 0.8.9λΆ€ν„° μž„μ‹œ 파일과 영ꡬ μ €μž₯μ†Œλ₯Ό λ‹€λ₯Έ 파일 μ‹œμŠ€ν…œμ— 넣을 수 μžˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ 이 경우 λΉ„μš©μ΄ 적게 λ“œλŠ” 이름 λ³€κ²½ μž‘μ—… λŒ€μ‹  2개의 파일 μ‹œμŠ€ν…œ μ „μ²΄μ—μ„œ 파일이 λ³΅μ‚¬λ©λ‹ˆλ‹€. λ”°λΌμ„œ μ£Όμ–΄μ§„ μœ„μΉ˜μ—μ„œ uwsgi_temp_path λͺ…λ ΉμœΌλ‘œ μ„€μ •λ˜λŠ” μ €μž₯된 파일과 μž„μ‹œ 파일 포함 디렉터리 λͺ¨λ‘ λ™μΌν•œ 파일 μ‹œμŠ€ν…œμ— λ°°μΉ˜ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

이 λͺ…령은 정적 λ³€κ²½ λΆˆκ°€ 파일의 둜컬 볡사본을 μƒμ„±ν•˜λŠ” 데 μ‚¬μš©λ©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

location /images/ {
    root               /data/www;
    error_page         404 = /fetch$uri;
}

location /fetch/ {
    internal;

    uwsgi_pass         backend:9000;
    ...

    uwsgi_store        on;
    uwsgi_store_access user:rw group:rw all:r;
    uwsgi_temp_path    /data/temp;

    alias              /data/www/;
}
Syntax:  uwsgi_store_access users:permissions ...;
Default: uwsgi_store_access user:rw;
Context: http, server, location

μƒˆλ‘œ μƒμ„±λœ 파일 및 디렉터리에 λŒ€ν•œ μ•‘μ„ΈμŠ€ κΆŒν•œμ„ μ„€μ •ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€.

uwsgi_store_access user:rw group:rw all:r;

λͺ¨λ“  κ·Έλ£Ή λ˜λŠ” λͺ¨λ“  μ•‘μ„ΈμŠ€ κΆŒν•œμ΄ μ§€μ •λ˜λ©΄ μ‚¬μš©μž κΆŒν•œμ΄ μƒλž΅λ  수 μžˆμŠ΅λ‹ˆλ‹€.

uwsgi_store_access group:rw all:r;
Syntax:  uwsgi_temp_file_write_size size;
Default: uwsgi_temp_file_write_size 8k|16k;
Context: http, server, location

uwsgi μ„œλ²„μ—μ„œ μž„μ‹œ 파일둜의 응닡 버퍼링이 ν™œμ„±ν™”λœ 경우 μž„μ‹œ νŒŒμΌμ— ν•œ λ²ˆμ— κΈ°λ‘λ˜λŠ” λ°μ΄ν„°μ˜ 크기λ₯Ό μ œν•œν•©λ‹ˆλ‹€. 기본적으둜 ν¬κΈ°λŠ” uwsgi_buffer_size 및 uwsgi_buffers λͺ…λ ΉμœΌλ‘œ μ„€μ •λ˜λŠ” 2개 λ²„νΌλ‘œ μ œν•œλ©λ‹ˆλ‹€. μž„μ‹œ 파일의 μ΅œλŒ€ ν¬κΈ°λŠ” uwsgi_max_temp_file_size λͺ…λ ΉμœΌλ‘œ μ„€μ •λ©λ‹ˆλ‹€.

Syntax:  uwsgi_temp_path path [level1 [level2 [level3]]];
Default: uwsgi_temp_path uwsgi_temp;
Context: http, server, location

uwsgi μ„œλ²„μ—μ„œ μˆ˜μ‹ λœ 데이터와 ν•¨κ»˜ μž„μ‹œ νŒŒμΌμ„ μ €μž₯ν•˜λŠ” 디렉터리λ₯Ό μ •μ˜ν•©λ‹ˆλ‹€. μ§€μ •λœ 디렉터리 μ•„λž˜ μ΅œλŒ€ 3개 μˆ˜μ€€μ˜ ν•˜μœ„ 디렉터리 계측 ꡬ쑰λ₯Ό μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, λ‹€μŒ κ΅¬μ„±μ—μ„œ

uwsgi_temp_path /spool/nginx/uwsgi_temp 1 2;

μž„μ‹œ νŒŒμΌμ€ λ‹€μŒκ³Ό 같을 수 μžˆμŠ΅λ‹ˆλ‹€.

/spool/nginx/uwsgi_temp/7/45/00000123457

uwsgi_cache_path λͺ…λ Ήμ˜ use_temp_path λ§€κ°œλ³€μˆ˜λ„ μ°Έμ‘°ν•˜μ„Έμš”.