Leantime / docker-leantime

Official Docker Image for Leantime https://leantime.io
GNU Affero General Public License v3.0
190 stars 86 forks source link

Container behind Nginx Proxy (HTTP) #26

Closed AnthonyLELUYER closed 4 years ago

AnthonyLELUYER commented 4 years ago

Hello,

I'm testing leantime with a docker-compose, and I have an issue with my proxy.

It's a simple Nginx proxy without https yet, as it's a local domain.

Here is my docker-compose:

leantime_db:
    image: linuxserver/mariadb
    volumes:
      - ./leantime:/config
    restart: always
    environment:
        MYSQL_ROOT_PASSWORD: '321.qwerty'
        MYSQL_DATABASE: 'leantime'
        MYSQL_USER: 'admin'
        MYSQL_PASSWORD: '321.qwerty'
    ports:
      - "3306:3306"

  leantime_web:
    image: local-leantime
    environment:
      LEAN_DB_HOST: 'leantime_db'
      LEAN_DB_USER: 'admin'
      LEAN_DB_PASSWORD: '321.qwerty'
      LEAN_DB_DATABASE: 'leantime'
    ports:
      - "9000:9000"
      - "8125:80"
      - "8126:443"
    depends_on:
      - leantime_db

I changed the database image (mysql doesn't run on ARM7 arch) and built the leantime image myself as it's running on a Raspberry Pi 4.

Here is my Nginx reverse-proxy conf:

server {
    listen 80;
    server_name work.home;
    access_log /var/log/nginx/work-http.log;
    location /.well-known {
        alias /var/www/html/work.home/.well-known;
    }
    location / {
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        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-Proto $scheme;
        proxy_pass http://192.168.1.101:8125;
    }
}

It's the same template I use for all other services, and it's working great. However I think it's in conflict with Apache inside Leantime.

When I access http://192.168.1.101:8125/install, the installation page pops up. When I access http://work.home/install, I'm redirected (301) to https.

I tried the LEAN_APP_URL settings but it's not working. Does anyone happen to have the same issue ?

marcelfolaron commented 4 years ago

Hi, letting LEAN_UPP_URL should fix this issue. Can you check what happens when you set LEAN_APP_URL and enter the site via the IP (It should redirect you to the domain if set up correctly)?

On Sun, Jul 12, 2020 at 10:16 AM Anthony LE LUYER notifications@github.com wrote:

Hello,

I'm testing leantime with a docker-compose, and I have an issue with my proxy.

It's a simple Nginx proxy without https yet, as it's a local domain.

Here is my docker-compose:

leantime_db: image: linuxserver/mariadb volumes:

  • ./leantime:/config restart: always environment: MYSQL_ROOT_PASSWORD: '321.qwerty' MYSQL_DATABASE: 'leantime' MYSQL_USER: 'admin' MYSQL_PASSWORD: '321.qwerty' ports:
  • "3306:3306"

    leantime_web: image: local-leantime environment: LEAN_DB_HOST: 'leantime_db' LEAN_DB_USER: 'admin' LEAN_DB_PASSWORD: '321.qwerty' LEAN_DB_DATABASE: 'leantime' ports:

  • "9000:9000"
  • "8125:80"
  • "8126:443" depends_on:
  • leantime_db

I changed the database image (mysql doesn't run on ARM7 arch) and built the leantime image myself as it's running on a Raspberry Pi 4.

Here is my Nginx reverse-proxy conf:

server { listen 80; server_name work.home; access_log /var/log/nginx/work-http.log; location /.well-known { alias /var/www/html/work.home/.well-known; } location / { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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-Proto $scheme; proxy_pass http://192.168.1.101:8125; } }

It's the same template I use for all other services, and it's working great. However I think it's in conflict with Apache inside Leantime.

When I access http://192.168.1.101:8125/install, the installation page pops up. When I access http://work.home/install, I'm redirected (301) to https.

I tried the LEAN_APP_URL settings but it's not working. Does anyone happen to have the same issue ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Leantime/docker-leantime/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFQ2LVVETHWIF75VUDDR3HVXTANCNFSM4OX4SJTQ .

AnthonyLELUYER commented 4 years ago

Hi,

If I set up LEAN_APP_URL to http://work.home and access http://192.168.1.101:8125, it doesn't load the CSS and I'm not redirected. If I access http://work.home, I get redirected to https.

AnthonyLELUYER commented 4 years ago

Removing proxy_set_header X-Forwarded-Proto $scheme; will do the trick, no need for LEAN_APP_URL, it works as it should.

marcelfolaron commented 4 years ago

Thanks for the update!

olenoerby commented 2 years ago

I run the latest docker version and nothing helped while running and configuring NPM/Nginx Proxy Manager, so I tried mapping a local configuration.php file to /docker/leantime/config/configuration.php with all variables set, most importantly the line 4: public $appUrl = "https://leantime.domain.com";

This fixed the problem for me instantly. Not even a need to reload the container.

Just made a copy of configuration.sample.php and filled out the information.

The nginx proxy still forward https to http on the docker side, port 80 on the container and forces HTTPS and certificate with no issues. Works a charm.

Bonus, I found the easy way to set up e-mails as well.

The readme for this container is a bit lacking of more advanced setups.

Nelson361 commented 2 years ago

I run the latest docker version and nothing helped while running and configuring NPM/Nginx Proxy Manager, so I tried mapping a local configuration.php file to /docker/leantime/config/configuration.php with all variables set, most importantly the line 4: public $appUrl = "https://leantime.domain.com";

This fixed the problem for me instantly. Not even a need to reload the container.

Just made a copy of configuration.sample.php and filled out the information.

The nginx proxy still forward https to http on the docker side, port 80 on the container and forces HTTPS and certificate with no issues. Works a charm.

Bonus, I found the easy way to set up e-mails as well.

The readme for this container is a bit lacking of more advanced setups.

Can you elaborate on how to find the file I need to edit? I'm having a similar problem.

marcelfolaron commented 2 years ago

Thank you! Would you mind writing a short “advanced” docker set up paragraph that we can add to the docs? https://github.com/Leantime/docs

Frankly, my docker knowledge is not where it needs to be to help with advanced set ups.

On Thu, Feb 17, 2022 at 12:10 PM Ole Nørby @.***> wrote:

I run the latest docker version and nothing helped while running and configuring NPM/Nginx Proxy Manager, so I tried mapping a local configuration.php file to /docker/leantime/config/configuration.php with all variables set, most importantly the line 4: public $appUrl = "https://leantime.domain.com https://leantime.domain.com";

This fixed the problem for me instantly. Not even a need to reload the container.

Just made a copy of configuration.sample.php and filled out the information.

The nginx proxy still forward https to http on the docker side, port 80 on the container and forces HTTPS and certificate with no issues. Works a charm.

Bonus, I found the easy way to set up e-mails as well.

The readme for this container is a bit lacking of more advanced setups.

— Reply to this email directly, view it on GitHub https://github.com/Leantime/docker-leantime/issues/26#issuecomment-1043199892, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALG4EFQ4PZ23KXHKFCCDPCDU3UTY3ANCNFSM4OX4SJTQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you commented.Message ID: @.***>