External SSL certificate causes Gateway Time-out on login (Docker) #2408

Closed
opened 2025-11-02 04:35:00 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @saitho on GitHub (Oct 13, 2018).

  • Gitea version (or commit ref): 1.5.2
  • Git version: not relevant
  • Operating system: Docker 17.05.0-ce on Ubuntu 16.04.5 LTS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I'm running Gitea with the official Docker image on a Plesk server. With plesk I am able to assign ports of a Docker container to a domain, which I did for the 3000 port of Gitea. It also allows setting up Let's Encrypt certificates for domains which I've setup for my Gitea instance.

For some reason I'm continuously getting a 504 Gateway Time-out when I try to login.
Now, when I set OFFLINE_MODE to true the login works without a problem.

As for the rest of my configuration:
I just set https in ROOT_URL. PROTOCOL is still http.
Setting the protocol to https results in a boot loop as described in #3865.

Screenshots

Originally created by @saitho on GitHub (Oct 13, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.5.2 - Git version: not relevant - Operating system: Docker 17.05.0-ce on Ubuntu 16.04.5 LTS - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description I'm running Gitea with the official Docker image on a Plesk server. With plesk I am able to assign ports of a Docker container to a domain, which I did for the 3000 port of Gitea. It also allows setting up Let's Encrypt certificates for domains which I've setup for my Gitea instance. For some reason I'm continuously getting a 504 Gateway Time-out when I try to login. Now, when I set OFFLINE_MODE to `true` the login works without a problem. As for the rest of my configuration: I just set https in ROOT_URL. PROTOCOL is still `http`. Setting the protocol to `https` results in a boot loop as described in #3865. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/question label 2025-11-02 04:35:00 -06:00
Author
Owner

@techknowlogick commented on GitHub (Oct 14, 2018):

Here is relevant part of my app.ini that runs gitea via http and has a reverse proxy (traefik) in front of it. I have traefik listening to port 80/443 and routing it to Gitea.

[server]
SSH_DOMAIN       = example.com
HTTP_PORT        = 3000
ROOT_URL         = https://example.com/
DOMAIN           = example.com

Closing this issue as it is more relevant to discuss on the forum, however hopefully the above might help you enough to get you on the right path.

@techknowlogick commented on GitHub (Oct 14, 2018): Here is relevant part of my app.ini that runs gitea via http and has a reverse proxy (traefik) in front of it. I have traefik listening to port 80/443 and routing it to Gitea. ``` [server] SSH_DOMAIN = example.com HTTP_PORT = 3000 ROOT_URL = https://example.com/ DOMAIN = example.com ``` Closing this issue as it is more relevant to discuss on the [forum](https://discourse.gitea.io/), however hopefully the above might help you enough to get you on the right path.
Author
Owner

@saitho commented on GitHub (Oct 14, 2018):

Not sure if I get you. That's basically my configuration. To make it clear:

[server]
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = example.com
HTTP_PORT        = 3000
ROOT_URL         = https://example.com/
DISABLE_SSH      = false
SSH_PORT         = 22
LFS_CONTENT_PATH = /data/git/lfs
DOMAIN           = example.com
LFS_START_SERVER = true
LFS_JWT_SECRET   = abcdefg12345
OFFLINE_MODE     = true
PROTOCOL	 = http

With that configuration the login works. Now when I turn OFFLINE_MODE back to false it throws a 504 error. To me that sounds strange as OFFLINE_MODE should only affect the Gravatar avatars.

@saitho commented on GitHub (Oct 14, 2018): Not sure if I get you. That's basically my configuration. To make it clear: ``` [server] APP_DATA_PATH = /data/gitea SSH_DOMAIN = example.com HTTP_PORT = 3000 ROOT_URL = https://example.com/ DISABLE_SSH = false SSH_PORT = 22 LFS_CONTENT_PATH = /data/git/lfs DOMAIN = example.com LFS_START_SERVER = true LFS_JWT_SECRET = abcdefg12345 OFFLINE_MODE = true PROTOCOL = http ``` With that configuration the login works. Now when I turn OFFLINE_MODE back to false it throws a 504 error. To me that sounds strange as OFFLINE_MODE should only affect the Gravatar avatars.
Author
Owner

@lafriks commented on GitHub (Oct 14, 2018):

You get timeout when libravatar tries to resolve avatar using dns

@lafriks commented on GitHub (Oct 14, 2018): You get timeout when libravatar tries to resolve avatar using dns
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2408