| Issue 905: | Invalid redirects to change pages when using proxy-https | |
| 2 people starred this issue and may be notified of changes. | Back to list |
Affected Version: 2.1.6.1 What steps will reproduce the problem? 1. Setup a gerrit review site with listenUrl = proxy-https://127.0.0.1:8081/ 2. Create a new change and request a review from someone, so they receive an email 3. Click on the link in the email (should be like: https://review.example.com/15) What is the expected output? What do you see instead? I expect to be taken to https://review.example.com/#q,15,n,z which is the correct change page. Instead, gerrit redirects my browser from https://review.example.com/15 to https://127.0.0.1:8081/#q,15,n,z Work-around: I use nginx as a reverse proxy and I've added two rewrite lines: rewrite ^/([0-9]+)$ https://review.example.com/#q,$1,n,z; rewrite ^/settings$ https://review.example.com/#settings; location / { proxy_pass http://127.0.0.1:8081; }
Apr 12, 2011
#1
sop@google.com
Status:
AwaitingInformation
Apr 12, 2011
I do have gerrit.canonicalWebUrl set, but you're right, nginx wasn't supplying the right headers. Thanks to this post on the mailing list: http://groups.google.com/group/repo-discuss/browse_thread/thread/a935e3a2b8e6b228?tvc=2 I now have a working nginx config: location / { proxy_pass http://127.0.0.1:8081; 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; } (I'm not sure the X-Real-IP header is needed but the other two are.) Would it be worth documenting this? (I'm happy to contribute a patch.) If so, what about renaming this page to just "Reverse Proxy": http://gerrit.googlecode.com/svn/documentation/2.1.6/config-apache2.html and then having "Apache 2 Configuration" and "Nginx Configuration" headings?
Apr 12, 2011
Yes, that sounds like a good idea. Please send a change for review to update the docs.
Status:
Accepted
Apr 13, 2011
(No comment was entered for this change.)
Status:
Submitted
Labels: FixedIn-2.1.7
May 31, 2011
(No comment was entered for this change.)
Status:
Released
|
|
| ► Sign in to add a comment |