-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
91 lines (71 loc) · 2.52 KB
/
nginx.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
worker_processes auto;
error_log stderr warn;
events {
multi_accept on;
use epoll;
worker_connections 20000;
}
http {
upstream api {
server api:3000;
keepalive 32;
}
upstream webapp {
server webapp:80;
keepalive 32;
}
sendfile on;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
client_max_body_size 2048M;
client_header_timeout 5s;
client_body_timeout 5m;
keepalive_timeout 650;
keepalive_requests 10000;
ssl_certificate /etc/nginx/tls/nginx.crt;
ssl_certificate_key /etc/nginx/tls/nginx.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
gzip on;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain text/css application/json image/svg+xml application/x-javascript text/xml application/xml application/xml+rss text/javascript application/hal+json;
proxy_http_version 1.1;
proxy_cache_path /tmp/nginx levels=1:2 keys_zone=webapp:50m inactive=60m;
proxy_cache_key "$scheme$request_method$host$request_uri";
server {
listen 80;
server_name _;
return 301 https://$http_host$request_uri;
}
server {
listen 443 ssl http2;
server_name _;
location / {
if ($http_x_forwarded_proto = "http") {
return 301 https://$host$request_uri;
}
proxy_cache webapp;
add_header X-Proxy-Cache $upstream_cache_status;
include /etc/nginx/proxy_headers.conf;
proxy_pass http://webapp/;
}
location /lb/ {
include /etc/nginx/proxy_headers.conf;
proxy_set_header X-Forwarded-Prefix /lb;
proxy_pass http://api/;
}
location /nginx_status {
stub_status on;
access_log off;
allow 172.0.0.0/8;
allow 127.0.0.1;
deny all;
}
add_header "X-UA-Compatible" "IE=Edge";
}
}