gogs: Absolute links images breaks nginx image displays as reverse proxy

Edit:

Only avatars seem to be affected.

  • Gogs version (or commit ref): 0.9.58.0726
  • Git version: 2.1.4
  • Operating system: Linux/Raspbian 8
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gogs.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Upgrading source build from 0.9.42.0712 to 0.9.58.0726 seems to have replaced image links on Gogs web dashboard with links to the http://%domain values in the custom app.ini values.

This results in broken images because I use nginx on port 80 and 443 to reverse proxy Gogs which runs on localhost:3000.

Reverting to 0.9.42.0712 leaves me with working image links.

0.9.42 seem to have linked to relative image paths so the reverse proxy could display images as if they were for eg. avatars: https://hostname/avatars/userid(eg. 2).

0.9.58 have broken images on the main page(ie. news, commits and your repos) and also on the profile page.

The gogs web server itself serves the image however absolute links to https://%domain values.

I could get the images from the gogs web server(macaron) by:

ssh gogs-host "curl localhost:3000/avatars/2" | display

“display” needs ImageMagick, but what matters is that the output is the avatar image for profile id 2. So what I mean that Macaron still works, but links to images break with nginx as a reverse proxy.

So what I request is reverting image links to the previous version if possible.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Patch has pushed to fix this issue, please test on develop branch or https://try.gogs.io.

cc @andreynering