phiilu / mailman

Mailman is a GUI to help you manage your email accounts stored in a MySQL/MariaDB database.
MIT License
70 stars 10 forks source link

White page after installation (docker) #23

Closed tombroeckers closed 6 years ago

tombroeckers commented 6 years ago

Hello,

I use the docker container and only get a white page.

The .env file: MAILMAN_HOST=127.0.0.1 MAILMAN_PORT=4000 MAILMAN_BASENAME=/

"docker logs mailman" says: Mailman is running on http://127.0.0.1:4000/ in production mode

My nginx configuration:

location /mailman/ {
    proxy_pass         http://127.0.0.1:4000/;
    proxy_redirect     off;
    proxy_set_header   Host $host;
    proxy_set_header   X-Real-IP $remote_addr;
    proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header   X-Forwarded-Host $server_name;
}

After opening the page with the browser, the log says: Mailman is running on http://127.0.0.1:4000/ in production mode GET / 304 4.963 ms - -

Anyboda got an idea?

Thanks in advance,

Thomas

tombroeckers commented 6 years ago

I've tested the installation with a ssh tunnel and everything is working fine, when I open http://localhost:4000 on my machine.

So it must be the combination with nginx and mailman...?

klausschreiber commented 6 years ago

I have the same problem using mailman with docker and nginx but haven't tested it with ssh Tunnel.

ghost commented 6 years ago

If it helps anyone, here are my Docker and nginx settings:

Subdomain:

docker run -d -p 4000:4000 --net="host" --env-file /etc/docker/envs/mailman.env --restart=always --name mailman phiilu/mailman
server {

  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name subdomain.domain.tld;

  client_max_body_size 100M;
  fastcgi_buffers 64 4K;

  location / {
    proxy_pass http://localhost:4000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
  }

  access_log /var/log/nginx/domain.tld/subdomain.domain.tld/access.log;
  error_log /var/log/nginx/domain.tld/subdomain.domain.tld/error.log;

}

Note: Since I have a wildcard certificate, the SSL settings are included elsewhere. If necessary, you'll need to include your SSL certificates above.

Subfolder:

Change location / { to location /nameOfSubfolder { within your nginx configuration and update the value of MAILMAN_BASENAME from / to /nameOfSubfolder in your env file as well.

klausschreiber commented 6 years ago

thanks for your help. I had an error in my env file. I changed MAILMAN_BASENAME from / to /nameOfSubfolder now. But the page stays blank. After changing the env file, I killed the docker container with docker kill ... , removed it with docker rm ... and started mailman again with command: docker run -d -p 4000:4000 --net="host" --env-file .env --restart=always --name mailman phiilu/mailman

I looked into html source code now and found the following code: <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"/><title>Mailman</title><link href="/static/css/main.b27653d9.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script type="text/javascript" src="/static/js/main.af4f7287.js"></script></body></html>

I think, there is the error: <link href="/static/css/main.b27653d9.css" rel="stylesheet"> should be <link href="/mailman/static/css/main.b27653d9.css" rel="stylesheet"> Same with javascript file, manifest and favicon. But how can I change this?

Thanks, Klaus

phiilu commented 6 years ago

Sorry I have been really busy.

I updated the Docker documentation. You can now us a separate Docker Image tagged :subfolder to deploy Mailman under a subfolder. After you run this Docker image, make sure to test in a fresh Incognito window to resolve cache issues. Hope this closes this issue now.