Bubka / 2FAuth

A Web app to manage your Two-Factor Authentication (2FA) accounts and generate their security codes
https://docs.2fauth.app/
GNU Affero General Public License v3.0
2.32k stars 152 forks source link

https not open #394

Closed 8178521 closed 1 month ago

8178521 commented 1 month ago

I used the following command to create a 2fauth Docker container: docker run -d --name=2fauth -p 8000:8000/tcp -v /docker/2fauth:/2fauth -e AUTHENTICATION_GUARD=web-guard --privileged=true -e ASSET_URL=https://xxx.com/ -e APP_URL=https://xxx.com/ -e TRUSTED_PROXIES=* 2fauth/2fauth

I used the following command to create a nginx Docker container: docker run -p 80:80 -p 443:443 --name nginx -v /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /docker/nginx/log:/var/log/nginx -v /docker/nginx/ssl:/etc/nginx/ssl --privileged=true -d nginx:latest

and nginx.conf

server {
    listen 80;
    server_name xxx.com;
    rewrite ^(.*) https://$server_name$1 permanent;
    }

server {
    listen 443 ssl;
    server_name xxx.com;
    ssl_certificate /etc/nginx/ssl/server.crt;
    ssl_certificate_key /etc/nginx/ssl/server.key;
   location / {
            proxy_pass http://172.18.0.2:8000;
            }
   }

But I found some issues:

  1. I tried to open the web and log in at https://xxx.com/, but the page won't load.
  2. I run “curl https://xxx.com” in the DOS , and then opened the web page at https://xxx.com/ in a browser, the page loaded success.
  3. After five minutes, the web page at https://xxx.com/ became inaccessible again, and I needed to repeat step 2。

why ???

Bubka commented 1 month ago

duplicate