Skip to content

Commit

Permalink
docs: mi/docker-compose-update
Browse files Browse the repository at this point in the history
  • Loading branch information
hajjimo committed Sep 7, 2024
1 parent 08dc85c commit feb1f82
Showing 1 changed file with 34 additions and 35 deletions.
69 changes: 34 additions & 35 deletions packages/documentation/src/content/docs/integration/prod/nginx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Generate the Let’s encrypt certificates:
certbot certonly --manual --preferred-challenges=dns --email EMAIL --server https://acme-v02.api.letsencrypt.org/directory --agree-tos -d DOMAIN
```

:::note
Domain can be in wildcard format. You will also need to update the TXT record in this step.
:::
Expand All @@ -39,25 +38,25 @@ Next update the DNS records to point to the static external IP address of the vo

| service | URL | example |
| --------- | ---------------- | ---------------------- |
| admin | admin.DOMAIN | admin.myrafiki.com |
| auth | auth.DOMAIN | auth.myrafiki.com |
| connector | connector.DOMAIN | connector.myrafiki.com |
| admin | admin.DOMAIN | admin.myrafiki.com |
| ilp | ilp.DOMAIN | ilp.myrafiki.com |

## Server preparation

Create nginx configuration files for every exposed domain:

### Auth
### Admin

```sh
server {
server_name auth.myrafiki.com;

server_name admin.myrafiki.com;

listen 443 ssl;

ssl_certificate /etc/letsencrypt/live/auth.myrafiki.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/auth.myrafiki.com/privkey.pem;
ssl_certificate /etc/letsencrypt/live/admin.myrafiki.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/admin.myrafiki.com/privkey.pem;

include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
Expand All @@ -73,33 +72,33 @@ server {

proxy_pass_request_headers on;

proxy_pass http://localhost:3002;
proxy_pass http://localhost:4010;
}
}

server {
server_name auth.myrafiki.com;
server_name admin.myrafiki.com;

listen 80;

if ($host = auth.myrafiki.com) {
if ($host = admin.myrafiki.com) {
return 301 https://$host$request_uri;
}

return 404;
}
```
### Admin
### Auth
```sh

server_name admin.myrafiki.com;
server {
server_name auth.myrafiki.com;

listen 443 ssl;

ssl_certificate /etc/letsencrypt/live/admin.myrafiki.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/admin.myrafiki.com/privkey.pem;
ssl_certificate /etc/letsencrypt/live/auth.myrafiki.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/auth.myrafiki.com/privkey.pem;

include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
Expand All @@ -115,33 +114,32 @@ server {

proxy_pass_request_headers on;

proxy_pass http://localhost:4010;
proxy_pass http://localhost:3002;
}
}

server {
server_name admin.myrafiki.com;
server_name auth.myrafiki.com;

listen 80;

if ($host = admin.myrafiki.com) {
if ($host = auth.myrafiki.com) {
return 301 https://$host$request_uri;
}

return 404;
}
```
### ILP
### Connector
```sh
server {
server_name ilp.myrafiki.com;
server_name connector.myrafiki.com;

listen 443 ssl;

ssl_certificate /etc/letsencrypt/live/ilp.myrafiki.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ilp.myrafiki.com/privkey.pem;
ssl_certificate /etc/letsencrypt/live/connector.myrafiki.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/connector.myrafiki.com/privkey.pem; # managed by Certbot

include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
Expand All @@ -157,32 +155,33 @@ server {

proxy_pass_request_headers on;

proxy_pass http://localhost:4000;
proxy_pass http://localhost:3002;
}
}

server {
server_name ilp.myrafiki.com;
server_name connector.myrafiki.com;

listen 80;

if ($host = ilp.myrafiki.com) {
return 301 https://$host$request_uri;
if ($host = connector.myrafiki.com) {
return 301 https://$host$request_uri;
}

return 404;
}
```
### Connector
### ILP
```sh
server {
server_name connector.myrafiki.com;
server_name ilp.myrafiki.com;

listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/connector.myrafiki.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/connector.myrafiki.com/privkey.pem; # managed by Certbot

ssl_certificate /etc/letsencrypt/live/ilp.myrafiki.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ilp.myrafiki.com/privkey.pem;

include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
Expand All @@ -198,17 +197,17 @@ server {

proxy_pass_request_headers on;

proxy_pass http://localhost:3002;
proxy_pass http://localhost:4000;
}
}

server {
server_name connector.myrafiki.com;
server_name ilp.myrafiki.com;

listen 80;

if ($host = connector.myrafiki.com) {
return 301 https://$host$request_uri;
if ($host = ilp.myrafiki.com) {
return 301 https://$host$request_uri;
}

return 404;
Expand Down

0 comments on commit feb1f82

Please sign in to comment.