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

Review screen not opening with new screen
Ignore empty lines in Diff View Change Screen
Gerrit change-id to git commit-id
How to setup Gerrit without any authentication?
How to start Gerrit in Windows 7 after Initialization
How do I merge Gerrit instances without losing history
Buildbot nightly build is failing to checkout the branch
Serve custom commit-msg hook from Gerrit
Customize Gerrit sign in page
Gerrit rejected push for valid LDAP member
Gerrit submit change after abandoning its parent
Gerrit - Reload Plugins to incorporate changes
Adding gerrit label, but not able to see it properly in review page
Make a list inside another list in a gerrit comment
How to assign access rights to a Gerrit project using API / SSH?
How to change a patchset and push it as a new one?

Categories

HOME
maven
compiler-construction
winforms
wso2-am
keycloak
path-finding
plot
read-eval-print-loop
razor
react-redux
yarn
youtube-api-v3
v8
fsm
retrofit
alpha
blueprintjs
ojdbc
acquia
opengl-es-2.0
android-youtube-api
rascal
circular-dependency
usergrid
commonmark
carthage
serverless-framework
clearcase-ucm
reactcsstransitiongroup
text-rendering
crystal-reports-2008
google-pagespeed
visual-composer
java-3d
bootstrap-tour
devops
dxf
sqlcipher
replaceall
ejabberd-module
windows-server-2000
file-rename
microsoft-chart-controls
google-rich-snippets
bcd
gtrendsr
copying
calibre
force-layout
x11-forwarding
neuroscience
texmaker
netcdf4
node-sass
qwt
user-accounts
network-flow
pnotify
clean-architecture
typescript1.8
knockout-components
parallel-data-warehouse
ableton-live
httplistener
infix-notation
moveit
fadeout
hexdump
tform
iad
rtbkit
google-places
python-3.2
jqgrid-formatter
tarjans-algorithm
cakephp-3.1
arcanist
system32
skos
apache-commons-net
npapi
formatjs
nstableviewcell
castle
project-planning
htmlcleaner
comexception
jboss-weld
access-rights
spring-io
flash-builder4.5
batterylevel
qt-faststart
rabl
referrer
dbproviderfactories
transactionscope
subgurim-maps
coredump
xtype
html-input
blitz++
infrastructure
sef
boost-smart-ptr
scripting-languages
genealogy
grid-system
rtml

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App