Topic: Adding Django Site to IredMail
==== BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version: 0.9.9 MARIADB edition.
- Downloadable installer
- Linux distribution: Ubuntu Server 18.04LTS
- Store mail accounts in which backend: MySQL
- Web server: Nginx
====
The situation is this:
I has installed IredMAil and is working perfect. (A lot of troubles with dns and ssl but thats other history).
Now I have installed in the same VM a Django Syte that is running with Gunicorn in port 8001 and is Publish in port 81 with nginx.
(I can tell cause if i do a: wget localhost:81 > I download the index of my django page)
BUUUUT!
If I try to get from another pc inside or outside the network to this webpage it always redirect me to /mail/ in port 443 and give me the iredmail page... can you help me please???
It dont matter even if I hardcode the http://cannava.com.ar > It send me to: https://cannava.com.ar/mail/
00-default-ssl.conf
#
# Note: This file must be loaded before other virtual host config files,
#
# HTTPS
server {
listen 443;
server_name _;
index index.php index.html;
location /mail/ {
root /var/www/html;
}
include /etc/nginx/templates/misc.tmpl;
include /etc/nginx/templates/ssl.tmpl;
include /etc/nginx/templates/iredadmin.tmpl;
include /etc/nginx/templates/roundcube.tmpl;
include /etc/nginx/templates/sogo.tmpl;
include /etc/nginx/templates/netdata.tmpl;
include /etc/nginx/templates/php-catchall.tmpl;
include /etc/nginx/templates/stub_status.tmpl;
}
cannavase.conf
#
# Note: This file must be loaded before other virtual host config files,
#
# HTTP
server {
listen 81;
# listen 4431 ssl;
server_name cannava.com.ar;
# ssl on;
# ssl_certificate /etc/nginx/ssl/cannava.pem;
# ssl_certificate_key /etc/nginx/ssl/cannava.key;
# Permitir subir cannavases de hasta 50M
root /opt/cannavase/cannavase;
access_log /opt/cannavase/nginx_access.log;
error_log /opt/cannavase/nginx_error.log;
location /archivos/ {
}
location /static/ {
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
proxy_pass http://localhost:8001/;
}
}
Important:
I put port 81 cause this VM is behind a HAPROXY that send both port 80 to 81 and 443 to 443.
Thanks for your time, hugs!
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.