Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to configure nginx for mailu #2057

Closed
Daisuke-sama opened this issue Mar 22, 2019 · 5 comments
Closed

how to configure nginx for mailu #2057

Daisuke-sama opened this issue Mar 22, 2019 · 5 comments
Labels

Comments

@Daisuke-sama
Copy link

Daisuke-sama commented Mar 22, 2019

Info:

  • Docker version Docker version 18.09.2, build 6247962
  • Laradock commit latest
  • System info (PC):
  • System info disto/version: win10

Issue:

I have successfully installed Mailu. But when I try to go to my http://mail.tax.loc I am getting to the main page of my website which lays under http://tax.loc . Maybe I need to add additional nginx config for the mail subdomain? If yes, then how it should look, could you advise please?

Thanks!

Other info

MAILU_VERSION=latest
MAILU_RECAPTCHA_PUBLIC_KEY=<my_code>
MAILU_RECAPTCHA_PRIVATE_KEY=<my_code>
# Main mail domain
MAILU_HTTP_PORT=6080
MAILU_HTTPS_PORT=60443
MAILU_DOMAIN=tax.loc
MAILU_INIT_ADMIN_USERNAME=admin
MAILU_INIT_ADMIN_PASSWORD=admin
# Hostnames for this server, separated with comas
MAILU_HOSTNAMES=mail.tax.loc
# Postmaster local part (will append the main mail domain)
MAILU_POSTMASTER=admin
# Set to a randomly generated 16 bytes string
MAILU_SECRET_KEY=secret
# Choose how secure connections will behave (value: letsencrypt, cert, notls, mail)
MAILU_TLS_FLAVOR=cert
# Authentication rate limit (per source IP address)
MAILU_AUTH_RATELIMIT=10/minute;1000/hour
# Opt-out of statistics, replace with "True" to opt out
MAILU_DISABLE_STATISTICS=False
# Message size limit in bytes
# Default: accept messages up to 50MB
MAILU_MESSAGE_SIZE_LIMIT=50000000
# Will relay all outgoing mails if configured
MAILU_RELAYHOST=
# Networks granted relay permissions, make sure that you include your Docker
# internal network (default to 172.17.0.0/16)
MAILU_RELAYNETS=172.16.0.0/12
# Fetchmail delay
MAILU_FETCHMAIL_DELAY=600
# Recipient delimiter, character used to delimiter localpart from custom address part
# e.g. localpart+custom@domain;tld
MAILU_RECIPIENT_DELIMITER=+
# DMARC rua and ruf email
MAILU_DMARC_RUA=admin
MAILU_DMARC_RUF=admin
# Welcome email, enable and set a topic and body if you wish to send welcome
# emails to all users.
MAILU_WELCOME=True
MAILU_WELCOME_SUBJECT=Welcome to your new email account
MAILU_WELCOME_BODY=Welcome to your new email account, if you can read this, then it is configured properly!
# Path to the admin interface if enabled
MAILU_WEB_ADMIN=/admin
# Path to the webmail if enabled
MAILU_WEB_WEBMAIL=/webmail
# Website name
MAILU_SITENAME=Example Mail
# Linked Website URL
MAILU_WEBSITE=http://mail.tax.loc
# Default password scheme used for newly created accounts and changed passwords
# (value: SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
MAILU_PASSWORD_SCHEME=SHA512-CRYPT
# Expose the admin interface (value: true, false)
MAILU_ADMIN=true
# Choose which webmail to run if any (values: roundcube, rainloop, none)
MAILU_WEBMAIL=rainloop
# Dav server implementation (value: radicale, none)
MAILU_WEBDAV=radicale

Nginx config of my local website tax.loc

server {

    listen 80;
    listen [::]:80;

    server_name tax.loc;
    root /var/www/public;
    index index.php index.html index.htm;

    location / {
         try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_pass php-upstream;
        fastcgi_index index.php;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        #fixes timeouts
        fastcgi_read_timeout 600;
        include fastcgi_params;
    }

    location ~ /\.ht {
        deny all;
    }

    location /.well-known/acme-challenge/ {
        root /var/www/letsencrypt/;
        log_not_found off;
    }

    error_log /var/www/error.log;
    access_log /var/www/access.log;
}

@Daisuke-sama
Copy link
Author

Additionally, I found that when just mailu containers running it also doesn't work. Website unavailable, like website unexists.

@webard
Copy link

webard commented Mar 24, 2019

tax.loc:6080. Look at:

MAILU_HTTP_PORT=6080
MAILU_HTTPS_PORT=60443

@ahkui
Copy link
Contributor

ahkui commented Mar 27, 2019

update .env
from

MAILU_VERSION=latest

to

MAILU_VERSION=1.5

If use caddy

http://mail.tax.loc {
    proxy / mailu-front {
        transparent
        websocket
    }
}

If use nginx

server {

    listen 80;
    listen [::]:80;

    server_name mail.tax.loc;
    location / {
      proxy_pass      http://mailu-front;
      proxy_set_header        Host                     $host;
      proxy_set_header        X-Real-IP              $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants