title: Run Teampass in docker with a running nginx proxy
body: <p>@Moderators: can you please add the Tag teampass to the tag list?</p>
  
  <p>I want to run <a href="http://teampass.net/" rel="nofollow">Teampass</a> as a docker container with a nginx as a proxy.   </p>
  
  <p>I'm not sure if the problem, that Teampass brings it own Apache and works against my nginx or, if I got something else completely wrong.</p>
  
  <p>I enter this like this
  <a href="https://i.stack.imgur.com/9J9c0.png" rel="nofollow"><img src="https://i.stack.imgur.com/9J9c0.png" alt="enter image description here"></a></p>
  
  <p>The problem is, that it's not passing this page, because the connection to the mySQL port is not working.</p>
  
  <p>When I try to install it, without a running nginx , everything works as expected. But when I'm using nginx, it's not running anymore</p>
  
  <p>docker-compose file:  </p>
  
  <pre><code>teampass:
  container_name: teampass
  image: teampass/teampass
  ports:
  - 127.0.0.1:8787:80
  volumes:
  - /opt/teampass:/teampass
  links:
  - teampass_mysql
  
  teampass_mysql:
  restart: always
  image: mysql/mysql-server:5.5
  ports:
  - 127.0.0.1:13306:3306
  environment:
  - MYSQL_ROOT_PASSWORD=TEAMPASS_MYSQL_ROOT_PASSWORD
  - MYSQL_DATABASE=TEAMPASS_MYSQL_DATABASE
  - MYSQL_PASSWORD=TEAMPASS_MYSQL_PASSWORD
  - MYSQL_USER=TEAMPASS_MYSQL_USER
  volumes:
  - /opt/dbteampass:/var/lib/mysql
  </code></pre>
  
  <p>nginx file:</p>
  
  <pre><code>upstream teampass {
      server 127.0.0.1:8787;
  }
  
  upstream sqlteampass {
      server 127.0.0.1:13306;
  }
  
  server {
    listen 80;
    server_tokens off;
    server_name teampass.domain.tld;
    return 301 https://$host$request_uri;
  }
  
  server {
    listen 443 ssl;
    server_tokens off;
    server_name teampass.domain.tld;
  
    ssl_certificate /path/fullchain.pem;
    ssl_certificate_key /path/privkey.pem;
  
    location / {
      proxy_set_header        Host $host:$server_port;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;
      proxy_pass              http://teampass;
    }
  }
  
  
  
  server {
    listen 80;
    server_tokens off;
    server_name sql.teampass.domain.tld;
    return 301 https://$host$request_uri;
  }
  
  server {
    listen 443 ssl;
    server_tokens off;
    server_name sql.teampass.domain.tld;
  
    ssl_certificate /path/fullchain.pem;
    ssl_certificate_key /path/privkey.pem;
  
    location / {
      proxy_set_header        Host $host:$server_port;
      proxy_set_header        X-Real-IP $remote_addr;
      proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header        X-Forwarded-Proto $scheme;
      proxy_pass              http://sqlteampass;
    }
  }
  </code></pre>