mailtrain
mailtrain copied to clipboard
Running all the ports on different paths of the same domain.
Hi,
I'm new to mailtrain and trying the insatllation for the first time. I have an nginx proxy in place already in my server, and for installing mailtrain, I have used one domain name for trusted port, and for the other two, I am trying to redirect them on different paths of the same domain by doing configuration in nginx-proxy So, if my trusted URL --> "mailtrain.example.com" sandbox URL --> "mailtrain.example.com/sbox" public URL --> "mailtrain.example.com/public"
Now, when I am trying to edit the templates, the Mosaico Template Designer is not getting rendered, instead that iframe is blank.
My docker-compose file is as follows:
version: '3'
services:
mysql:
image: mariadb:10.4
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=mailtrain
- MYSQL_USER=mailtrain
- MYSQL_PASSWORD=password
volumes:
- ./mysql-data:/var/lib/mysql
redis:
image: redis:5
volumes:
- ./redis-data:/data
mongo:
image: mongo:4-xenial
volumes:
- ./mongo-data:/data/db
mailtrain:
image: mailtrain/mailtrain:latest
ports:
- "1000:3000"
- "1001:3003"
- "1002:3004"
volumes:
- ./mailtrain-files:/app/server/files
environment:
- URL_BASE_TRUSTED=https://mailtrain.example.com
- URL_BASE_SANDBOX=https://mailtrain.example.com/sbox
- URL_BASE_PUBLIC=https://mailtrain.example.com/public-lists
- VIRTUAL_HOST=mailtrain.example.com
- VIRTUAL_PORT=3000
- LETSENCRYPT_HOST=mailtrain.example.com
- LETSENCRYPT_EMAIL=<email>
- WWW_PROXY=true
- MYSQL_PASSWORD=password
volumes:
mysql-data:
redis-data:
mongo-data:
mailtrain-files:
My nginx-proxy config is :
server {
listen 80;
listen [::]:80;
server_name mailtrain.example.com;
access_log /var/log/nginx/mailtrain.log;
return 301 https://$host$request_uri;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://172.18.0.20:3000/;
proxy_redirect off;
}
location /sbox/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://172.18.0.20:3003/ ;
proxy_redirect off;
}
location /public/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://172.18.0.20:3004/ ;
proxy_redirect off;
}
}
Thanks.