-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
73 lines (55 loc) · 1.91 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
events {}
http {
include mime.types;
limit_req_zone $binary_remote_addr zone=ip:1m rate=1000r/s;
limit_conn_zone $binary_remote_addr zone=addr:1m;
server {
listen 443 ssl;
http2 on;
http2_max_concurrent_streams 128;
keepalive_requests 1000;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
add_header Strict-Transport-Security "max-age=15768000" always;
ssl_certificate /etc/letsencrypt/live/you-note.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/you-note.ru/privkey.pem;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_types text/plain ;
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;
location /api/ {
limit_req zone=ip burst=12 delay=8;
limit_conn addr 5;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 40M;
proxy_pass http://you-note.ru:8080/api/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_http_version 1.1;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
}
location /images/ {
alias /opt/images/;
etag on;
try_files $uri = 404;
}
location / {
alias /opt/public/;
try_files $uri $uri/ /index.html;
index index.html;
}
}
server {
access_log /var/log/nginx/access_http.log;
error_log /var/log/nginx/error_http.log;
if ($host = you-note.ru) {
return 301 https://$host$request_uri;
}
listen 80;
server_name you-note.ru;
return 404;
}
}