-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx-test.conf
94 lines (85 loc) · 3.02 KB
/
nginx-test.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
events {
worker_connections 512; ## Default: 1024
multi_accept on;
}
http {
proxy_buffering on;
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=jira_static:10m inactive=60m use_temp_path=off;
proxy_cache_valid any 8h;
#proxy_cache_key "$scheme$request_method$host$request_uri";
sendfile on;
sendfile_max_chunk 5m;
tcp_nodelay on;
client_max_body_size 50M;
keepalive_timeout 65;
upstream jiradc-local {
server 127.0.0.1:8081;
}
server {
# Note that it's listening on port 80
listen 8080 default_server;
error_log /dev/stdout debug;
server_name example.com www.example.com;
charset utf-8;
location / {
gzip_static on;
gzip_comp_level 5;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://jiradc-local;
}
## static assets
location /s/ {
gzip_static on;
gzip_comp_level 5;
proxy_cache jira_static;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Cached-SideCar true;
proxy_ignore_headers Cache-Control;
add_header Cache-Control public;
proxy_pass http://jiradc-local;
proxy_ignore_headers "Set-Cookie";
proxy_hide_header "Set-Cookie";
expires 8h;
access_log on;
}
## attachment caching
location /secure/attachment/ {
gzip_static on;
gzip_comp_level 5;
proxy_cache jira_static;
proxy_cache_valid 200 60s;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Cached-SideCar true;
proxy_ignore_headers Cache-Control;
add_header Cache-Control public;
proxy_pass http://jiradc-local;
proxy_ignore_headers "Set-Cookie";
proxy_hide_header "Set-Cookie";
expires 1m;
access_log on;
}
## Icons
location /images/icons/emoticons/ {
gzip_static on;
gzip_comp_level 5;
proxy_cache jira_static;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Cached-SideCar true;
add_header Cache-Control public;
proxy_ignore_headers Cache-Control;
proxy_pass http://jiradc-local;
proxy_ignore_headers "Set-Cookie";
proxy_hide_header "Set-Cookie";
expires 8h;
access_log on;
}
}
}