I'm having a super weird issue. I'm trying to use nginx to wrap gerrit in SSL/HTTPS, and it's only working if I let dev.company.com/ point to gerrit (I'd prefer dev.company.com/gerrit/ as the web server should also host other services.)
This is the only working solution I've been able to find.
gerrit's etc/gerrit.config:
[gerrit]
canonicalWebUrl = https://dev.company.com/
[httpd]
listenUrl = proxy-https://127.0.0.1:8081/
(snip)
nginx's configuration in sites-available:
server {
listen 443 ssl;
server_name dev.company.com;
ssl on;
(ssl certificates blah blah)
location / {
proxy_pass http://127.0.0.1:8081;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
If I change to the following:
gerrit.config:
[gerrit]
canonicalWebUrl = https://dev.company.com/gerrit/
[httpd]
listenUrl = proxy-https://127.0.0.1:8081/
(snip)
nginx config:
server {
listen 443 ssl;
server_name dev.company.com;
ssl on;
(ssl certificates blah blah)
location /gerrit/ {
proxy_pass http://127.0.0.1:8081/;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
}
}
(Note the trailing slash on the proxy_pass.)
Things work except requests with escaped characters (such as %2F, which gerrit has a lot of.) So, gerrit, as a site, will halfway work.
I feel that this answer should lead in the right direction, but I simply couldn't get things to work.
Edit: I think this discussion hits the same bug.