Bug 255156 - www/gitea + nginx reverse proxy 502 bad gateway after FreeBSD 13.0-RELEASE upgrade
Summary: www/gitea + nginx reverse proxy 502 bad gateway after FreeBSD 13.0-RELEASE up...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
Depends on:
Reported: 2021-04-17 17:10 UTC by Mohammad S. Babaei
Modified: 2021-04-26 14:52 UTC (History)
1 user (show)

See Also:
stb: maintainer-feedback-


Note You need to log in before you can comment on or make changes to this bug.
Description Mohammad S. Babaei 2021-04-17 17:10:18 UTC
A portion of nginx config log:

2021/04/17 17:04:28 [error] 28714#100610: *9 connect() to failed (61: Connection refused) while connecting to upstream, client: XXX.XXX.XXX.XXX, server: example.com, request: "GET / HTTP/2.0", upstream: "", host: "example.com", referrer: "https://example.com/"
2021/04/17 17:04:29 [error] 28714#100610: *9 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client:, server: example.com, request: "GET /favicon.ico HTTP/2.0", upstream: "", host: "example.com", referrer: "https://example.com/"

No config changes for Gitea or Nginx. I also have some similar issues with SOGo https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255124

I have already rebuilt all ports and packages. Unfortunately, no luck.
Comment 1 stb 2021-04-18 08:20:50 UTC
I'm testing new builds of Gitea in a 13.0-RELEASE VM, and Gitea on its own appears to be working fine.

Can you access localhost:15000 with curl/fetch/wget? Is gitea listing on port 15000 (netstat -an|grep LISTEN|grep 15000, or lsof -p with the pid of gitea)? The default port for gitea is 3000.
Comment 2 Mohammad S. Babaei 2021-04-18 16:04:14 UTC
Sorry, I downgraded https://forums.freebsd.org/threads/escaping-from-13-0-release-hell-and-back-to-12-2-release.79901/ since it also had issues with SOGo Groupware https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255124
Comment 3 Mohammad S. Babaei 2021-04-18 16:04:56 UTC
And, both Gitea and SOGo are working just fine again on 12.2-RELEASE.
Comment 4 stb 2021-04-26 07:49:26 UTC

are you still experiencing the issue? Then in order to suggest any solution or workaround, I would need answers to my questions: is Gitea starting up and opening a listening port, and can you talk to it on that port? The error message you've posted indicates that nginx cannot talk to Gitea, but there's no indication why Gitea wouldn't have opened that port in the log you posted.

Comment 5 Mohammad S. Babaei 2021-04-26 14:51:20 UTC
Hello Stefan,

Unfortunately, I am no on FreeBSD 13.0-RELEASE anymore. I downgraded using these instructions to 12.2-RELEASE https://forums.freebsd.org/threads/escaping-from-13-0-release-hell-and-back-to-12-2-release.79901/

And, without changing any Gitea configuration, everything worked out of the box. This was a production server and I could not afford the downtime. Also, as I mentioned, SOGo also had issues. Fortunately, downgrading solved that one too. I am sure there are some incompatibilities between Gitea, SOGo, and 13.0-RELEASE. That's why I will stick to 12.X-RELEASE until 13.1-RELEASE.

Sorry for not being more helpful.
Comment 6 Mohammad S. Babaei 2021-04-26 14:52:30 UTC
Forgot to mention that I also did not change anything in Nginx, either before or after upgrade/downgrade. Just the usual rebuilding of every port.