The comex app is in 2 parts that are unified inside docker via an [inner nginx](https://github.com/moma/comex2/blob/master/setup/dockers/comex2_services/comex2_php_and_services.nginx.conf). However on the deployment machine (host machine that runs the dockers), we may want to have a webserver to redirect everything inside. This is the**outer** nginx exemple.
The comex app is in 2 parts that are unified inside docker via an [inner nginx](https://github.com/moma/comex2/blob/master/setup/dockers/comex2_services/comex2_php_and_services.nginx.conf). However on the deployment machine (host machine that runs the dockers), we usually want to have a webserver to redirect everything inside. This is this**outer** nginx exemple.
### 1) Install nginx
### 1) Install nginx
...
@@ -24,36 +24,43 @@ sudo nano comex2_outer.conf
...
@@ -24,36 +24,43 @@ sudo nano comex2_outer.conf
```
```
This below is a full config exemple you can paste in nano:
This below is a full config exemple you can paste in nano:
- it serves the comex app (legacy php), in `/`
- it serves the comex php, in `/*.php`
- it also serves registration app, in `/services/user/register`
- it also serves services (user, api), in `/services/.*` via python
```nginxconf
```nginxconf
# Full server config: php comex as root and api + reg as services subpath
# Full server config: docker comex (php + python server) on 8080
If you use this configuration without changing anything else than the paths, then *remove* all other confs from `sites-enabled` (because this one is written to be standalone)
If you use this configuration without changing anything else than the paths, then *remove* all other confs from `sites-enabled` (because this one is written to be standalone).
If you have several apps already then add the server entries (especially the proxy to 8080) beside your previous `server{}` sections.