-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
65 lines (54 loc) · 1.94 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
user nginx;
worker_processes auto;
events { worker_connections 1024; }
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
types_hash_max_size 4096;
default_type application/octet-stream;
client_max_body_size 100M;
error_log /dev/stdout info;
access_log /dev/stdout;
# include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
server {
server_name annotate.nilay.page;
listen 80;
root /var/site/;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
# Error pages
error_page 404 /404.html;
location = /404.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
# Main server
location / {
index /index.html;
try_files $uri /index.html;
}
# Backend proxy
location /api/ {
proxy_pass http://backend:5000/;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_http_version 1.1;
}
# SSL stuff
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/nginx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/nginx/privkey.pem; # managed by Certbot
include /etc/nginx/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/nginx/ssl-dhparams.pem; # managed by Certbot
}
}