/
nginx.conf
50 lines (40 loc) · 1.26 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
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream core {
server core:8080 max_fails=3 fail_timeout=60s;
}
gzip on; # Enables compression, incl Web API content-types
gzip_types
"application/json;charset=utf-8" application/json
"application/javascript;charset=utf-8" application/javascript text/javascript
"application/xml;charset=utf-8" application/xml text/xml
"text/css;charset=utf-8" text/css
"text/plain;charset=utf-8" text/plain;
server {
listen 80;
port_in_redirect off;
root /data/apps;
client_max_body_size 25m;
# Redirect required to prevent 403 error on / access
rewrite ^/$ $scheme://$http_host/dhis-web-dashboard redirect;
location / {
include mime.types;
try_files $uri $uri/ $uri/index.html @core;
}
# location /screenshot {
# proxy_set_header Host $http_host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_pass http://screenshot:9000;
# }
location @core {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://core;
}
}
}