-
Notifications
You must be signed in to change notification settings - Fork 13
/
nginx.conf
78 lines (63 loc) · 2.07 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
74
75
76
77
78
http {
# Run nginx with "npm run start-production"
# Stop nginx with "npm run stop-production"
# Reload nginx without stopping server "npm reload-production"
#logging
access_log /var/log/nginx/sce.access.log;
# when we run docker-compose up for the first time, a default
# network is created that all the containers are attached to.
# this default network name is the directory name + "_default".
# As a result, the network name will be "clark_default".
# To establish a connection to the containers, we can do
# <container name>.<network name>, and that's what happens below.
upstream webserver {
server sce-frontend:3000;
}
upstream mainendpoints {
server sce-main-endpoints:8080;
}
server {
#re-routing http to https server
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
# actual nginx server
server {
#443(https)
listen 443 ssl;
# ssl certificate
ssl_certificate sce_sjsu_edu_cert.cer;
ssl_certificate_key sce.key;
# TLS protocol (remember to update to the newest protocols for best security)
ssl_protocols TLSv1.2 TLSv1.3;
location ~ /s/(.*)$ {
proxy_pass http://cleezy-nginx.sce;
}
location ~ /qr/(.*)$ {
proxy_pass http://cleezy-nginx.sce;
}
location ~ ^/transit/ {
resolver 127.0.0.11 valid=15s;
proxy_set_header Host $host;
set $upstream http://sceta-nginx.sce;
proxy_pass $upstream;
rewrite ^/transit(.*)$ $1 break;
}
location ~ ^/transit$ {
return 302 $scheme://$http_host/transit/;
}
#Load balancer
location /api {
proxy_pass http://mainendpoints;
}
location /spark {
proxy_pass https://spark-scesjsu.webflow.io/;
}
location / {
proxy_pass http://webserver;
}
}
}
events { }