forked from fleetman-ci-cd-demo/fleetman-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf.j2
41 lines (32 loc) · 1.16 KB
/
nginx.conf.j2
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
events {
worker_connections 4096; ## Default: 1024
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
include /etc/nginx/mime.types;
server {
listen 80;
location /api {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
{% if SPRING_PROFILES_ACTIVE == 'local-microservice' %}
proxy_pass http://fleetman-api-gateway:8080/;
{% else %}
proxy_pass http://fleetman-api-gateway.default.svc.cluster.local:8080/;
{% endif %}
proxy_read_timeout 90;
proxy_http_version 1.1; # recommended with keepalive connections - http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_http_version
# WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location / {
root /usr/share/nginx/html;
}
}
}