🔗
Custom domain + HTTPS
Use a custom domain with Twake
We do not offer the possibility to edit the nginx configuration present in the docker-compose containers yet. To enable https you first need to install nginx and configure on your machine.
Your nginx installation will be used to forward the requests from https to the docker-compose http port.
The last step is to tell Twake that the frontend is accessed from a different domain and protocol to handle the redirections.

Use port 80 or 443 over https

To use 443 create a new nginx install and attach a proxy to port 8000 + certauto. If you use Apache2 go on the Apache2 configuration page.
Follow this thread if you have issues with websockets and reverse proxy: https://community.twake.app/t/twake-on-docker-behind-apache-proxy/78
1
# /etc/nginx/site-enabled/default
2
location / {
3
proxy_pass http://127.0.0.1:8000;
4
}
5
6
location /socketcluster/ {
7
proxy_pass http://127.0.0.1:8000/socketcluster/;
8
# this magic is needed for WebSocket
9
proxy_http_version 1.1;
10
proxy_set_header Upgrade $http_upgrade;
11
proxy_set_header Connection "upgrade";
12
proxy_set_header Host $http_host;
13
proxy_set_header X-Real-IP $remote_addr;
14
proxy_connect_timeout 7d;
15
proxy_send_timeout 7d;
16
proxy_read_timeout 7d;
17
}
Copied!

Configure domain name

You must edit the configuration in both configuration/frontend/environment.ts and configuration/backend/Parameters.php
1
//Exemple of environment.ts
2
export default {
3
env_dev: false,
4
mixpanel_enabled: false,
5
sentry_dsn: false,
6
mixpanel_id: false,
7
front_root_url: 'https://twake.acme.com',
8
api_root_url: 'https://twake.acme.com',
9
websocket_url: 'wss://twake.acme.com'
10
};
Copied!
1
//To change in Parameters.php
2
...
3
"env" => [
4
...
5
"server_name" => "https://twake.acme.com/",
6
],
7
...
Copied!
Dont forget to restart your docker-compose 😉 and rebuild the frontend: docker-compose exec nginx yarn build
Last modified 9mo ago
Copy link