-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from openimis/feature/modular-reverse-proxy
modular reverse proxy
- Loading branch information
Showing
13 changed files
with
173 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
location /${REACT_APP_API_URL}/ { | ||
|
||
proxy_pass http://${backend}; | ||
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-Host $server_name; | ||
proxy_set_header X-Forwarded-Proto https; | ||
} | ||
location = /check_user/ { | ||
internal; | ||
proxy_pass_request_body off; | ||
proxy_set_header Content-Length ""; | ||
proxy_set_header X-Original-URI $request_uri; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_pass http://${backend}/${REACT_APP_API_URL}/core/users/current_user/; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
location /.well-known/acme-challenge/ { | ||
root /var/www/certbot; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
|
||
location / { | ||
return 302 https://$host/${PUBLIC_URL}/; | ||
} | ||
|
||
location /${PUBLIC_URL} { | ||
try_files $uri $uri/ /${PUBLIC_URL}/index.html; | ||
#error_page 404 $scheme://$host/front/; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
location /lightning/ { | ||
|
||
rewrite /lightning/(.*) /$1 break; | ||
proxy_pass http://${lightning}; | ||
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 https; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
location /opensearch/ { | ||
auth_request /check_user/; | ||
proxy_pass http://${opensearch}; | ||
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 https; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
proxy_set_header Authorization "Basic ${OPENSEARCH_BASIC_TOKEN}"; | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
|
||
location /${ROOT_MOBILEAPI}/ { | ||
|
||
#this rewrite rule is required to remove "ROOT_MOBILEAPI" because implicite rule (/ at the end of the url) donc work with variable | ||
rewrite /${ROOT_MOBILEAPI}/(.*) /$1 break; | ||
proxy_pass http://${restapi}; | ||
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 https; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set $backend "backend:8000"; | ||
set $opensearch "opensearch-dashboards:5601"; | ||
set $lightning "lightning:4000"; | ||
set $frontend "lightning:4000"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# openIMIS Frontend Reference Implementation : Linux | ||
|
||
This repository holds the configuration files for the openIMIS Frontend Reference Implementation. | ||
It serves 2 distinct use cases: | ||
|
||
- developers who want to implement new modules or modify existing frontend modules of openIMIS | ||
- distributors who want to assemble modules into a Docker image for delivery | ||
|
||
Note: please, refer to [openIMIS Frontend localisation](i18n.md) to provide translations and bind user's language to a locale for data format (dates, numbers,...) | ||
|
||
This repo branches, tags,... are maintained by openIMIS official delivery team who use it to build the official openIMIS Docker images containing the official modules (versions) list. | ||
|
||
In case of troubles, please consult/contact our service desk via our [ticketing site](https://openimis.atlassian.net/servicedesk/customer). | ||
|
||
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# openIMIS Frontend Reference Implementation : Windows Docker | ||
|
||
This repository holds the configuration files for the openIMIS Frontend Reference Implementation: | ||
|
||
- Legacy web application | ||
- Modular front end | ||
|
||
Please look for the direction on the openIMIS Wiki: https://openimis.atlassian.net/wiki/spaces/OP/pages/963182705/MO1.1+Install+the+modular+openIMIS+using+Docker | ||
|
||
Note: the modular frontend is part of the release ZIP of the legacy webapp, if the modular frontend need to be changed then new modular frontend static files need to be placed in /inetroot/www/openIMIS/front | ||
|
||
Note 2: The docker file can be change to build first the frontend by uncommenting the "downloader" related lines. | ||
|
||
This repo branches, tags,... are maintained by openIMIS official delivery team who use it to build the official openIMIS Docker images containing the official modules (versions) list. | ||
|
||
In case of troubles, please consult/contact our service desk via our [ticketing site](https://openimis.atlassian.net/servicedesk/customer). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# reverse proxy | ||
|
||
openIMIS serves different service base on URI, the default are: | ||
|
||
- /api/: backend | ||
- /front/: frontend | ||
- /lightning/: lightning | ||
- /opensearch/: opensearch | ||
- /restapi/: C# restAPI (discontinued) | ||
|
||
|
||
to allow user to easily change the revers proxy the conf/locations folder contains a file per service, | ||
|
||
changing the file extension or removing the file will remove the reverse proxy configuration | ||
|
||
file update can be made, but one must be careful when using variable because at the container start, all ENV system variable will be substituted by their value (see entrypoints.sh to see how it is done) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include the configuration use in the loc files | ||
include location/var.conf | ||
# include the loc files | ||
include location/*.loc |