Gitlab Omnibus – Change the Nginx Port

Ignore original text below. The correct method is to amend the /etc/gitlab/gitlab.rb file with the port e.g.:

external_url “”
nginx[‘ssl_certificate’] = “/etc/pki/tls/certs/pubkey.pem”
nginx[‘ssl_certificate_key’] = “/etc/pki/tls/private/privkey.pem”

Then run:

gitlab-ctl reconfigure


Doing a ps -ef | grep nginx allowed me to track down the configuration file:


That file specified the port number (see below) and can be changed:

server {
listen *:8181 default_server;         # e.g., listen; In most cases *:80 is a good idea
server_name;     # e.g., server_name;
server_tokens off;     # don't show the version number, a security best practice
root /opt/gitlab/embedded/service/gitlab-rails/public;

Restart gitlab:

gitlab-ctl restart



One Response to “Gitlab Omnibus – Change the Nginx Port”

  1. Katsuro Kurosaki

    Finally! A simple, neat, working solution to enable SSL and change default port on gitlab! Thank you very much, you made my day 😀
    Best regards!


Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>