gerrit


Gerrit redirects to wrong URL


I have installed Gerrit 2.12.3 on my Ubuntu Server 16.04 system.
Gerrit is listening on http://127.0.0.1:8102.
behind an nginx server, which is listening on https://SERVER1:8102.
Some contents of the etc/gerrit.config file is as follow:
[gerrit]
basePatr = git
canonicalWebUrl = https://SERVER1:8102/
[httpd]
listenUrl = proxy-https://127.0.0.1:8102/
And some contents of my nginx settings is as follow:
server {
listen 10.10.20.202:8102 ssl;
ssl on;
ssl_certificate /etc/nginx/ssl/server1.crt;
ssl_certificate_key /etc/nginx/ssl/server1.key;
location / {
# Allow for large file uploads
client_max_body_size 0;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8102;
}
}
Nearly all the function of Gerrit works very well now. But one problem I can not solved is that:
The url generated in notification email is https://SERVER1:8102/11 which seems right, but when I click the link, it redirects to https://SERVER1/#/c/11/ instead of https://SERVER1:8102/#/c/11/
Can anyone tell me how to solve it?
Thanks.
That the port of gerrit.canonicalWebUrl and httpd.listenUrl match makes no sense.
Specify as gerrit.canonicalWebUrl the URL that is accessible to your users through the Nginx proxy, e.g., https://gerrit.example.com.
This vhost in Nginx (listening to port 443) in turn is configured in the proxy to connect to the backend as specified in httpd.listenUrl, so e.g. port 8102 to which Gerrit would be listening in your case.
The canonicalWebUrl is just used that Gerrit knows its own host name, e.g., for sending email notifications IIRC.
You might also just follow Gerrit Documentation and stick to the ports as described there.
EDIT: I really noticed that you want the proxy AND Gerrit both to listen on port 8102 - on a public interface respectively on 127.0.0.1. While this would work, if you really make sure that Nginx is not binding to 0.0.0.0, I think it makes totally no sense. Don't you want your users to connect via HTTPS on port 443?

Related Links

Create new Gerrit project from pre existing git repository
error: addinfo_cache failed while cherrypicking
Searching Gerrit by Commit Message
Gerrit administator role
Pushing long commit message gerrit
Revert to older patch set version via the Gerrit UI?
Gerrit - Application Error - Intraline difference not available due to server error
Gerrit configuration
Gerrit: Inline code comments
Gerrit revision workflow: merge conflicts and re-approval
error : remote gerrit already exists
How to subscribe to a gerrit project?
link to other system issue number in gerrit code review page based on commit message
gerrit: use LDAP auth and have a gerrit-local account for Jenkins
Not able to add comments on Gerrit. It rather gets added as Draft. What am I doing wrong?
Excluding author from peer reviewer list in gerrit

Categories

HOME
ms-access
arduino-uno
hive
cloud
openmp
proxy
dictionary
framework7
gis
jsrender
sql-server-2016
disassembler
pivotal-cloud-foundry
flyway4
azure-storage-tables
contact
slick-slider
primary-key
gnupg
izpack
imacros
fortumo
zebra-printers
hapi
serverless-framework
vaadin7
lombok
graphlab
highlight.js
text-rendering
functional-testing
mps
icloud-api
sparse-matrix
wtx
compatibility
large-file-upload
procdump
preg-match
media-queries
karaf
scorm2004
windows-dev-center
textmate
environment-modules
wixsharp
retina-display
hockeyapp
streamsets
uft-api
sqlite2
ws-security
dynamic-reports
isbn
youcompleteme
promela
mplayer
sqldf
color-profile
background-service
angular-strap
abcpdf9
angular-cache
clang-static-analyzer
make-install
bluemix-app-scan
pagerank
ptrace
two-factor-authentication
teamcity-8.0
thredds
marching-cubes
atk4
apache-commons-fileupload
fluid-dynamics
lustre
html-helper
valueconverter
stxxl
mcts
tidy
robotics-studio
wsdl-2.0
selected
path-separator
propertyeditor
pysimplesoap
tridion-worldserver
netdna-api
boost-filesystem
spyware
site.master
ext3
firefox4
anti-piracy
project-hosting
gacutil
scripting-languages

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App