-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.conf
46 lines (37 loc) · 1.5 KB
/
default.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
# Ref.: https://www.nginx.com/blog/rate-limiting-nginx/
limit_req_zone $binary_remote_addr zone=frontend_zone:10m rate=10r/s;
limit_req_zone $binary_remote_addr zone=backend_zone:10m rate=1r/s;
server {
listen 80;
return 301 https://$host$request_uri;
}
server {
# For local development only
# listen 80 default_server;
# For production
listen 443 ssl default_server;
server_name isthismalware.net;
ssl_protocols TLSv1.2;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA HIGH !RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
ssl_certificate /etc/letsencrypt/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/privkey.pem;
#access_log /var/log/nginx/host.access.log main;
# Refs.: https://stackoverflow.com/questions/62562017/docker-compose-with-nginx-reverse-a-website-and-a-restful-api
# Refs.: https://stackoverflow.com/questions/15353935/correct-proxy-path-in-nginx-conf
# Frontend
location / {
# Ref.: https://www.nginx.com/blog/rate-limiting-nginx/
limit_req zone=frontend_zone burst=20;
proxy_pass http://frontend;
}
# Backend
location /api/ {
# Ref.: https://www.nginx.com/blog/rate-limiting-nginx/
limit_req zone=backend_zone burst=20;
proxy_pass http://backend/;
client_max_body_size 1M;
}
location = /404.html {
internal;
}
}