Ticket #2231: nginx.conf

File nginx.conf, 1.5 KB (added by mr.oliver.nadj@…, 5 years ago)
Line 
1user nginx;
2worker_processes auto;
3error_log /dev/stdout info;
4pid /var/run/nginx.pid;
5events {
6 worker_connections 1024;
7}
8daemon off;
9http {
10 include /etc/nginx/mime.types;
11 default_type application/octet-stream;
12 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
13 '$status $body_bytes_sent "$http_referer" '
14 '"$http_user_agent" "$http_x_forwarded_for"';
15 access_log /dev/stdout;
16 sendfile on;
17 keepalive_timeout 65;
18 proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=static-cache:200m max_size=45g inactive=60m use_temp_path=off;
19 proxy_cache_key "$scheme$host$request_uri";
20
21 map $upstream_http_content_length $no_cache {
22 default 1;
23 "~^[0-9]{1,6}$" 0;
24 }
25
26 server {
27 listen 80 default_server;
28 server_name _;
29 location / {
30 proxy_set_header Host "docs.nginx.com";
31 proxy_cache static-cache;
32 proxy_ignore_headers Cache-Control;
33 add_header X-Cache-Status $upstream_cache_status;
34 set $proxy_cache_key $scheme$proxy_host$uri$is_args$args;
35 proxy_cache_valid 5d;
36 proxy_no_cache $no_cache;
37 # if you uncomment the line below it makes $no_cache = 1
38 # proxy_cache_bypass $no_cache;
39 add_header X-No-Cache $no_cache;
40 proxy_pass https://docs.nginx.com:443;
41 }
42 }
43}
44
45
46#checkout: curl -I -s http://127.0.0.1/images/icons/NGINX-Docs-horiz-white-type.svg | grep X-