-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
92 lines (74 loc) · 2.1 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
http {
client_max_body_size 0;
server {
listen 80;
server_name _;
location / {
return 301 https://$host$request_uri;
}
location /public {
root /usr/share/nginx/html;
}
}
server {
listen 443;
server_name localhost;
ssl on;
ssl_certificate /etc/nginx/cert/cert.crt;
ssl_certificate_key /etc/nginx/cert/key.key;
try_files $uri/index.html $uri @test-app;
location @test-app {
proxy_redirect ~^http:\/\/(.*)$ https://$1;
client_max_body_size 512M;
proxy_read_timeout 1h;
proxy_pass http://host.docker.internal:4040;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
server {
listen 80;
server_name test.teachbase.local;
try_files $uri/index.html $uri @web-app;
location @web-app {
proxy_redirect ~^http:\/\/(.*)$ https://$1;
client_max_body_size 512M;
proxy_read_timeout 1h;
proxy_pass http://host.docker.internal:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
listen 443;
server_name *.teachbase.local;
ssl on;
ssl_certificate /etc/nginx/cert/cert.crt;
ssl_certificate_key /etc/nginx/cert/key.key;
try_files $uri/index.html $uri @web-app;
location /public {
include /etc/nginx/mime.types;
root /usr/share/nginx/html;
try_files $uri/index.html $uri @web-app;
}
location @web-app {
proxy_redirect ~^http:\/\/(.*)$ https://$1;
client_max_body_size 512M;
proxy_read_timeout 1h;
proxy_pass http://host.docker.internal:3000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
location /ws/ {
proxy_pass http://host.docker.internal:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 950s;
}
}
}
events {
}