-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
81 lines (73 loc) · 2.34 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
worker_processes auto;
worker_cpu_affinity auto;
worker_rlimit_nofile 32768;
upstream node-backend {
server firstapp:3000;
server secondapp:3001;
}
events {
worker_connections 32768;
multi_accept on;
accept_mutex on;
}
http {
server {
listen 80;
listen [::]:80;
server_name api-node.com www.api-node.com;
return 301 https://$host$request_uri;
location / {
proxy_pass http://node-backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
proxy_connect_timeout 1d;
proxy_send_timeout 1d;
proxy_read_timeout 1d;
proxy_headers_hash_max_size 8192;
proxy_redirect off;
proxy_buffering off;
}
}
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name api-node.com www.api-node.com;
ssl_certificate /etc/nginx/ssl/intermediate.pem;
ssl_certificate_key /etc/nginx/ssl/cert.key;
ssl_protocols TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
ssl_session_cache shared:SSL:60m;
ssl_buffer_size 50k;
ssl_session_timeout 60m;
ssl_session_tickets off;
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
location / {
proxy_pass http://node-backend;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache_bypass $http_upgrade;
proxy_connect_timeout 1d;
proxy_send_timeout 1d;
proxy_read_timeout 1d;
proxy_headers_hash_max_size 8192;
proxy_redirect off;
proxy_buffering off;
}
}
tcp_nodelay on;
client_max_body_size 50m;
client_body_buffer_size 50k;
resolver 8.8.8.8 8.8.4.4;
resolver_timeout 1d;
}