-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
47 lines (34 loc) · 1.15 KB
/
nginx.conf
File metadata and controls
47 lines (34 loc) · 1.15 KB
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
events {
worker_connections 1024;
}
http {
proxy_cache_path /var/cache/nginx/talentmaker levels=1:2 keys_zone=talentmaker:10m max_size=2g inactive=1d use_temp_path=off;
# Redirect all requests to https if they're on http
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
# Main frontend
server {
listen 443 ssl;
server_name "talentmaker.ca" "www.talentmaker.ca";
ssl_certificate /etc/letsencrypt/live/talentmaker.ca/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/talentmaker.ca/privkey.pem;
location / {
proxy_cache talentmaker;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504 http_429;
proxy_pass http://localhost:3000;
}
}
# API
server {
listen 443 ssl;
server_name "api.talentmaker.ca";
ssl_certificate /etc/letsencrypt/live/talentmaker.ca/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/talentmaker.ca/privkey.pem;
location / {
proxy_pass http://localhost:3333;
}
}
}