Mifos Docs
Search…
nginx config for ACEFintech and/or LionFintech
ACEFintech and LionFintech has SpringBoot based backend application and React based GUI. Serving https requests and integrate gui with backend we using nginx load balancer.
ACEFintech is served within "/netbank" url and LionFintech is served "/lionfintech" url. ACEFintech backend is served from "http://localhost:8080/*". LionFintech backend is served from "http://localhost:8085/*"
/etc/nginx/nginx.conf
1
# For more information on configuration, see:
2
# * Official English Documentation: http://nginx.org/en/docs/
3
# * Official Russian Documentation: http://nginx.org/ru/docs/
4
5
user nginx;
6
worker_processes auto;
7
error_log /var/log/nginx/error.log;
8
pid /run/nginx.pid;
9
10
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
11
include /usr/share/nginx/modules/*.conf;
12
13
events {
14
worker_connections 1024;
15
}
16
17
http {
18
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
19
'$status $body_bytes_sent "$http_referer" '
20
'"$http_user_agent" "$http_x_forwarded_for"';
21
22
access_log /var/log/nginx/access.log main;
23
24
sendfile on;
25
tcp_nopush on;
26
tcp_nodelay on;
27
keepalive_timeout 65;
28
types_hash_max_size 2048;
29
server_tokens off;
30
31
gzip on;
32
gzip_types text/plain text/css;
33
gzip_comp_level 3;
34
35
add_header X-Content-Type-Options nosniff;
36
add_header X-Frame-Options SAMEORIGIN;
37
add_header X-XSS-Protection "1; mode=block";
38
39
include /etc/nginx/mime.types;
40
default_type application/octet-stream;
41
42
# Load modular configuration files from the /etc/nginx/conf.d directory.
43
# See http://nginx.org/en/docs/ngx_core_module.html#include
44
# for more information.
45
include /etc/nginx/conf.d/*.conf;
46
47
server {
48
listen 8081 default_server;
49
listen [::]:8081 default_server;
50
server_name _;
51
root /srv/nginx/acefintech/;
52
53
# Load configuration files for the default server block.
54
include /etc/nginx/default.d/*.conf;
55
56
location /netbank/ {
57
try_files $uri $uri/ /netbank/login;
58
}
59
60
location /lionfintech/ {
61
try_files $uri $uri/ /lionfintech/login;
62
}
63
64
# LionFinech urls
65
location ~ ^/lionfintech/api/(/?)(.*) {
66
proxy_set_header X-Real-IP $remote_addr;
67
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
68
proxy_pass http://10.2.0.95:8085/$2$is_args$args;
69
error_log /var/log/nginx/api_error.log debug;
70
}
71
72
# ACEFintech urls
73
location ~ ^/api/(/?)(.*) {
74
# Settings for local GUI development
75
# set $cors '';
76
# if ($http_origin ~ '^https?://(localhost:3000|acefintech\.mlabs\.dpc\.hu)') {
77
# set $cors 'true';
78
# }
79
#
80
# if ($cors = 'true') {
81
# add_header 'Access-Control-Allow-Origin' "$http_origin" always;
82
# add_header 'Access-Control-Allow-Credentials' 'true' always;
83
# add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
84
# add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
85
# required to be able to read Authorization header in frontend
86
# add_header 'Access-Control-Expose-Headers' 'Authorization' always;
87
# }
88
89
# if ($request_method = 'OPTIONS') {
90
# Tell client that this pre-flight info is valid for 20 days
91
# add_header 'Access-Control-Max-Age' 1728000;
92
# add_header 'Content-Type' 'text/plain charset=UTF-8';
93
# add_header 'Content-Length' 0;
94
# return 204;
95
# }
96
97
# set $http_origin 'acefintech.mlabs.dpc.hu';
98
proxy_set_header X-Real-IP $remote_addr;
99
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
100
proxy_pass http://10.2.0.95:8080/$2$is_args$args;
101
error_log /var/log/nginx/api_error.log debug;
102
}
103
104
105
location / {
106
}
107
108
109
error_page 404 /404.html;
110
location = /40x.html {
111
}
112
113
error_page 500 502 503 504 /50x.html;
114
location = /50x.html {
115
}
116
}
117
}
118
Copied!
Because
Copy link