Rumah > Artikel > pembangunan bahagian belakang > Nginx Wiki(已过时最新:http://nginxorg/en/docs/)
<span>location</span> / <span>{</span> proxy_pass <span>http</span>://localhost:<span>8000</span><span>;</span> proxy_set_header X-Real-IP <span>$remote_addr</span><span>;</span><span>}</span>
proxy_bind 192.168.1.1<span>;</span>
proxy_cache_bypass <span>$cookie_nocache</span><span>$arg_nocache</span><span>$arg_comment</span><span>;</span> proxy_cache_bypass <span>$http_pragma</span><span>$http_authorization</span><span>;</span>
proxy_cache_bypass <span>$http_my_secret_header</span><span>;</span>
proxy_cache_key <span>"$host$request_uri$cookie_user"</span><span>;</span>
proxy_cache_key <span>"$scheme$host$request_uri"</span><span>;</span>
proxy_cache_methods POST<span>;</span>
proxy_cache_path /data/nginx/cache/one levels<span>=</span><span>1</span>:<span>2</span> keys_zone<span>=</span>one:10m<span>;</span>
<span>/</span>data<span>/</span>nginx<span>/</span>cache<span>/</span>c<span>/</span><span>29</span><span>/</span>b7f54b2df7773722d382f4809d65029c
proxy_cache_path /data/nginx/cache/one levels<span>=</span><span>1</span> keys_zone<span>=</span>one:10m<span>;</span> proxy_cache_path /data/nginx/cache/two levels<span>=</span><span>2</span>:<span>2</span> keys_zone<span>=</span>two:100m<span>;</span> proxy_cache_path /data/nginx/cache/three levels<span>=</span><span>1</span>:<span>1</span>:<span>2</span> keys_zone<span>=</span>three:1000m<span>;</span>
proxy_cache_valid <span>200</span><span>302</span> 10m<span>;</span> proxy_cache_valid <span>404</span> 1m<span>;</span>
proxy_cache_valid 5m<span>;</span>
proxy_cache_valid <span>200</span><span>302</span> 10m<span>;</span> proxy_cache_valid <span>301</span> 1h<span>;</span> proxy_cache_valid any 1m<span>;</span>
proxy_ignore_headers X-Accel-Expires Expires Cache-Control<span>;</span>
<span>location</span> / <span>{</span> proxy_hide_header X-AspNet-Version<span>;</span> proxy_hide_header MicrosoftOfficeWebServer<span>;</span><span>}</span>
<span>location</span> / <span>{</span> proxy_pass <span>http</span>://backend_servers<span>;</span><span>}</span> <span>location</span> /files/ <span>{</span> proxy_pass <span>http</span>://fileserver<span>;</span> proxy_hide_header Content-Type<span>;</span><span>}</span>
proxy_method POST<span>;</span>
proxy_no_cache <span>$cookie_nocache</span><span>$arg_nocache</span><span>$arg_comment</span><span>;</span> proxy_no_cache <span>$http_pragma</span><span>$http_authorization</span><span>;</span>
proxy_pass <span>http</span>://localhost:<span>8000</span>/uri/<span>;</span>
proxy_pass <span>http</span>://unix:/path/to/backend.socket:/uri/<span>;</span>
proxy_set_header Host <span>$host</span><span>;</span>