Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url error when using nginx reverse proxy mode #17912

Closed
jue-jue-zi opened this issue Dec 5, 2021 · 1 comment
Closed

url error when using nginx reverse proxy mode #17912

jue-jue-zi opened this issue Dec 5, 2021 · 1 comment
Labels
issue/duplicate The issue has already been reported.

Comments

@jue-jue-zi
Copy link

Gitea Version

1.15.7

Git Version

2.25.1

Operating System

Ubuntu Ubuntu 20.04.3 LTS

How are you running Gitea?

Run the binary file downloaded from github releases with systemd and use nginx reverse proxy model for the gitea with the below configs:

  # gitea
  location /git/ {
      proxy_pass https://localhost:10080/;
      proxy_redirect off;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header Host $http_host;
      proxy_set_header Early-Data $ssl_early_data;

      client_max_body_size        10g;
      client_body_buffer_size     128k;
  }

And gitea config app.ini is as below:

[server]
PROTOCOL = https
DOMAIN = xxx.com
HTTP_PORT = 10080
ROOT_URL = %(PROTOCOL)s://%(DOMAIN)s/git/
CERT_FILE = /xxx/xxx.crt
KEY_FILE = /xxx/xxx.key
SSH_DOMAIN = %(DOMAIN)s
DISABLE_SSH = false
START_SSH_SERVER = true
SSH_PORT = 10022
SSH_LISTEN_HOST = 0.0.0.0
SSH_LISTEN_PORT = %(SSH_PORT)s
LFS_START_SERVER = true
LFS_CONTENT_PATH = /xxx/lfs
LFS_JWT_SECRET = xxx
OFFLINE_MODE = true

Database

MySQL

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Description

It works great when using the ROOT_URL to access the website. However, when we use another domain to access gitea, some problems appear (because we use different domains to access gitea in the LAN or the Internet). When accessing the issuse page with url https://xxx.com/git/issues, all the issuses shown in the list are linked to the ROOT_URL set in app.ini which leads to failed access. But the domains of other links in the page can automatically change to adapt to the current accessing host. I wonder if the links in the issue page can also automatically adapt to the current accessing host or if there's additional settings should be added to nginx to achieve this. Thanks.

Screenshots

image

@lunny
Copy link
Member

lunny commented Dec 5, 2021

I think it's duplicated with #17648

@techknowlogick techknowlogick added the issue/duplicate The issue has already been reported. label Dec 5, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported.
Projects
None yet
Development

No branches or pull requests

3 participants