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
Apache-2 with reverse proxy and sub-url broken #5962
Comments
Upgrading to the Current workaround was to downgrade to |
Downgrading seems to be the normal at the moment! |
Thanks for your high quality bug report ❤️ My initial suspicion is this line: Line 43 in 931da04
The |
BTW, it would be very helpful to check your Server configuration section on the |
Hmm, I am not able to reproduce with latest I set up reverse proxy via Caddy 1 and has [server]
EXTERNAL_URL = http://%(DOMAIN)s/gogs/
For my Caddyfile:
PS: I'm using localhost for testing, does it matter? |
Hi, it works for me with "EXTERNAL_URL" instead of ROOT_URL |
@whoo thanks for the info! I'm closing this until further input. |
First, thank you for this useful software.
Describe the bug
Commit 648d9e2 and after does not write the correct URLs for reverse proxying and sub-url with Apache 2, even after replacing the deprecated app.ini::[Server]ROOT_URL with app.ini::[Server]EXTERNAL_URL, causing the web client to be redirected to unexpected urls.
Gogs version or commit
648d9e2 "conf: overhaul server settings (#5928)" (2020-02-22 09:05:26 +0800 )
First appearance of undesired behavior.
The previous commit
5b14cc6 "docker: update link to Docker Hub and add info for gogs-rpi" works correctly.
I have checked the most recent commit, fe7b094 and it does not work correctly.
All gogs binaries were obtained from https://packager.io/gh/gogs/gogs
Git version
2.20.1
Operating system
Debian 10 (buster) x86_64
Database
sqlite
To Reproduce
Steps to reproduce the behavior:
Can you reproduce the bug at https://try.gogs.io?
No, cannot implement sub-url there.
Expected behavior
I have been using the configuration "apache-2-with-reverse-proxy" and "sub-url" by setting app.ini::[Server]ROOT_URL and apache.conf::ProxyPass, etc. as shown at:
https://gogs.io/docs/intro/faqs#how-do-i-set-up-a-sub-url-with-apache-2%3F
Curl shows this: (OK)
Actual behavior
However commit 648d9e2 and after shows the following behavior, and ultimately I cannot log into my gogs server. Replacing [Server]ROOT_URL with [Server]EXTERNAL_URL does not fix the situation.
Notice "Location:" header is not /gogs/user/login.
Notice Set-Cookie::Path=/ instead of Set-Cookie::Path=/gogs.
Notice link is "/user/login" instead of "/gogs/user/login"
Curl shows this: (NG)
Screenshots
None.
Additional context
Nothing relevant.
The text was updated successfully, but these errors were encountered: