Skip to content
Permalink
Browse files
FINCN-164 Implement changes suggested by #20 (comment)
  • Loading branch information
Juhan Aasaru authored and Juhan Aasaru committed Sep 10, 2019
1 parent bd68bea commit 0c5370b57471a8f9b7c2d44b747d1fcd16da0975
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 30 deletions.
@@ -18,7 +18,7 @@ RUN rm -f /etc/nginx/nginx.conf

COPY --from=node /usr/src/app/dist /usr/share/nginx/html

COPY ./scripts/nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./scripts/nginx/docker.nginx.conf /etc/nginx/nginx.conf

EXPOSE 8888

@@ -21,23 +21,8 @@

## Running from Docker container

### If you want to run other services from localhost

Then you need to add the following to hosts file.
```
127.0.0.1 provisioner-ms
127.0.0.1 identity-ms
127.0.0.1 office-ms
127.0.0.1 customer-ms
127.0.0.1 accounting-ms
127.0.0.1 portfolio-ms
127.0.0.1 deposit-account-management-ms
127.0.0.1 teller-ms
127.0.0.1 reporting-ms
127.0.0.1 cheques-ms
127.0.0.1 payroll-ms
127.0.0.1 group-ms
```
See [https://github.com/apache/fineract-cn-docker-compose](https://github.com/apache/fineract-cn-docker-compose)
for running all the Fineract-CN services from Docker.

## Versioning
The version numbers follow the [Semantic Versioning](http://semver.org/) scheme.
@@ -0,0 +1,157 @@
events {
worker_connections 4096; ## Default: 1024
}

http {

server {
listen 8888;
server_name localhost;
large_client_header_buffers 4 32k;

root /usr/share/nginx/html;
index index.html index.htm;
include mime.types;

location / {
try_files $uri /index.html;
}

# /api will server your proxied API that is running on same machine different port
# or another machine. So you can protect your API endpoint not get hit by public directly
location /identity/ {
proxy_pass http://identity-ms:2021;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/office/ {
proxy_pass http://office-ms:2023/office/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/customer/ {
proxy_pass http://customer-ms:2024/customer/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/accounting/ {
proxy_pass http://accounting-ms:2025/accounting/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/portfolio/ {
proxy_pass http://portfolio-ms:2026/portfolio/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/deposit/ {
proxy_pass http://deposit-account-management-ms:2027/deposit/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/teller/ {
proxy_pass http://teller-ms:2028/teller/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/reporting/ {
proxy_pass http://reporting-ms:2029/reporting/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/cheques/ {
proxy_pass http://cheques-ms:2030/cheques/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/payroll/ {
proxy_pass http://payroll-ms:2031/payroll/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

location /api/group/ {
proxy_pass http://group-ms:2032/group/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

#Static File Caching. All static files with the following extension will be cached for 1 day
location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
expires 1d;
}

gzip on;
gzip_http_version 1.1;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 1100;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_comp_level 9;
}
}
@@ -9,7 +9,7 @@ http {
server_name localhost;
large_client_header_buffers 4 32k;

root /usr/share/nginx/html;
root fims;
index index.html index.htm;
include mime.types;

@@ -20,7 +20,7 @@ http {
# /api will server your proxied API that is running on same machine different port
# or another machine. So you can protect your API endpoint not get hit by public directly
location /identity/ {
proxy_pass http://identity-ms:2021;
proxy_pass http://localhost:2021;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -31,7 +31,7 @@ http {
}

location /api/office/ {
proxy_pass http://office-ms:2023/office/;
proxy_pass http://localhost:2023/office/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -42,7 +42,7 @@ http {
}

location /api/customer/ {
proxy_pass http://customer-ms:2024/customer/;
proxy_pass http://localhost:2024/customer/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -53,7 +53,7 @@ http {
}

location /api/accounting/ {
proxy_pass http://accounting-ms:2025/accounting/;
proxy_pass http://localhost:2025/accounting/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -64,7 +64,7 @@ http {
}

location /api/portfolio/ {
proxy_pass http://portfolio-ms:2026/portfolio/;
proxy_pass http://localhost:2026/portfolio/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -75,7 +75,7 @@ http {
}

location /api/deposit/ {
proxy_pass http://deposit-account-management-ms:2027/deposit/;
proxy_pass http://localhost:2027/deposit/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -86,7 +86,7 @@ http {
}

location /api/teller/ {
proxy_pass http://teller-ms:2028/teller/;
proxy_pass http://localhost:2028/teller/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -97,7 +97,7 @@ http {
}

location /api/reporting/ {
proxy_pass http://reporting-ms:2029/reporting/;
proxy_pass http://localhost:2029/reporting/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -108,7 +108,7 @@ http {
}

location /api/cheques/ {
proxy_pass http://cheques-ms:2030/cheques/;
proxy_pass http://localhost:2030/cheques/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -119,7 +119,7 @@ location /api/cheques/ {
}

location /api/payroll/ {
proxy_pass http://payroll-ms:2031/payroll/;
proxy_pass http://localhost:2031/payroll/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@@ -130,7 +130,7 @@ location /api/payroll/ {
}

location /api/group/ {
proxy_pass http://group-ms:2032/group/;
proxy_pass http://localhost:2032/group/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';

0 comments on commit 0c5370b

Please sign in to comment.