-
Notifications
You must be signed in to change notification settings - Fork 9
/
vhost.conf
44 lines (36 loc) · 994 Bytes
/
vhost.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
SOMETHING=$(cat <<'END_HEREDOC'
echo '
#upstream docker-staticapp {
# server staticapp:80;
#}
#upstream docker-springboot {
# server springboot:5050;
#}
server {
listen 80;
# listen 80 default_server;
access_log /var/log/app/access.log;
error_log /var/log/app/error.log;
root /app;
index index.html;
location / {
try_files $uri $uri/ /index.html =404;
}
location @springboot {
proxy_pass http://localhost:5050;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
#proxy_set_header Host $host;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header X-Forwarded-Proto $scheme;
#proxy_set_header X-Forwarded-Port $server_port;
}
location ~ "^(.*)/(api)" {
root /usr/share/nginx/html;
try_files $uri $uri/ @springboot;
}
}' > ./default.conf
END_HEREDOC)
bash -c "${SOMETHING}"