-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.sample.conf
78 lines (66 loc) · 2.43 KB
/
nginx.sample.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
# REPLACE "DOMAIN.EXTENSION" with your site domain and extension - eg. umai.pw
# REPLACE "FRONTEND_PORT" with the port your Nuxt App is listening to - eg. 3000
# REPLACE "API_PORT" with the port your API is listening to - eg. 2000
# HTTP redirect
server {
listen 80;
listen [::]:80;
server_name .DOMAIN.EXTENSION;
location / {
return 301 https://$server_name$request_uri;
}
}
# Servers
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.DOMAIN.EXTENSION;
# SSL
ssl_certificate /etc/letsencrypt/live/DOMAIN.EXTENSION/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAIN.EXTENSION/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/DOMAIN.EXTENSION/chain.pem;
# Security
include nginxconfig.io/security.conf;
# Reverse Proxy
location / {
proxy_pass http://localhost:FRONTEND_PORT;
include nginxconfig.io/proxy.conf;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name api.DOMAIN.EXTENSION;
# SSL
ssl_certificate /etc/letsencrypt/live/api.DOMAIN.EXTENSION/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.DOMAIN.EXTENSION/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/api.DOMAIN.EXTENSION/chain.pem;
# Security
include nginxconfig.io/security.conf;
# Reverse Proxy
location / {
proxy_pass http://localhost:API_PORT;
include nginxconfig.io/proxy.conf;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name i.DOMAIN.EXTENSION;
# SSL
ssl_certificate /etc/letsencrypt/live/i.DOMAIN.EXTENSION/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/i.DOMAIN.EXTENSION/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/i.DOMAIN.EXTENSION/chain.pem;
# Security
include nginxconfig.io/security.conf;
# Serve Images
location / {
root /home/USERNAME/umai-api/uploads;
try_files $uri @frontend
include nginxconfig.io/proxy.conf;
}
location @frontend {
proxy_pass http://localhost:FRONTEND_PORT
include nginxconfig.io/proxy.conf;
}
}