Independantly from the backends like mysql or doors, the comex app is in two parts:
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 legacy php comex app
- the new python registration app
A good way to make the two coexist is to use nginx as follows
### 1) Install nginx
### 1) Install nginx
If you don't already have nginx on the deployment machine, follow these steps first:
If you don't already have nginx on the deployment machine, follow these steps first:
...
@@ -18,12 +15,12 @@ sudo service nginx status
...
@@ -18,12 +15,12 @@ sudo service nginx status
```
```
### 2) Replace nginx conf by our *comex+reg* configuration
### 2) Replace nginx conf by our comex2 configuration
Create the conf files for comex
Create the conf files for comex
```
```
cd /etc/nginx/sites-available
cd /etc/nginx/sites-available
sudo nano comex.conf
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:
...
@@ -31,41 +28,27 @@ This below is a full config exemple you can paste in nano:
...
@@ -31,41 +28,27 @@ This below is a full config exemple you can paste in nano:
- it also serves registration app, in `/services/user/register`
- it also serves registration app, in `/services/user/register`
```ini
```nginxconf
# Full server config: php comex as root and api + reg as services subpath
# Full server config: php comex as root and api + reg as services subpath