Skip to content

Possible to run under an existant nginx ? #70

@m333w

Description

@m333w

Hi all,

First thank's for this image :)

I would like to run the container under an existant nginx, so i run the contener like this :

docker run -p 666:80 -p 999:443 \
           -h email.domain.tld \
           -e "MYSQL_ROOT_PASSWORD=strongpassword" \
           -e "SOGO_WORKERS=2" \
           -e "TZ=Europe/Paris" \
           -e "POSTMASTER_PASSWORD=strongpassword" \
           -e "IREDAPD_PLUGINS=['reject_null_sender', 'reject_sender_login_mismatch', 'greylisting', 'throttle', 'amavisd_wblist', 'sql_alias_access_policy']" \
           -v /srv/docker.app/iredmail/mysql:/var/lib/mysql \
           -v /srv/docker.app/iredmail/vmail:/var/vmail \
           -v /srv/docker.app/iredmail/clamav:/var/lib/clamav \
           --name=iredmail lejmr/iredmail:mysql-latest

My email.conf in nginx :

server {
    listen         80;
    server_name    email.domain.tld;
    return         301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name email.domain.tld;
	
    ssl on;
    ssl_certificate /etc/nginx/ssl/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/privkey.pem;
	
    access_log /var/log/nginx/iredmail-access.log combined;
    error_log /var/log/nginx/iredmail-error.log error;
  
    client_max_body_size 512M;

    location / {
        proxy_pass http://email.domain.tld:666/mail;
    }
  
    location /mail {
        proxy_pass http://email.domain.tld:666/mail;
    }
  
    location /iredadmin {
        proxy_pass http://email.domain.tld:666/iredadmin;
    }
    location /sogo {
        proxy_pass http://email.domain.tld:666/sogo;
    }
}

But when i go on email.domain.tld any browser say "bad redirection"
What i am missing ?

Hope someone can help me

Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions