Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #9677

Closed
Open
Created Sep 28, 2015 by Administrator@rootOwner

Cannot redirect to https if both on same port

Created by: OverByThere

Hi there,

If I set my system up to run on port 3123, and I want to redirect users from http to https on that port (i.e. they go to http://server:3123 it should go to https://server:3123).

Using the below settings in gitlab.rb, this does not work:

external_url 'https://server:3123'
nginx['listen_port'] = 3123
nginx['redirect_http_to_https'] = true
nginx['ssl_client_certificate'] = "/etc/gitlab/ssl/COMODORSAAddTrustCA.crt" # Most root CA's are included by default
nginx['ssl_certificate'] = "/etc/gitlab/ssl/unifiedcert.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/local.key"
nginx['ssl_ciphers'] = "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256

I also tried adding nginx['redirect_http_to_https_port'] = 3123, however this didn't make a difference, other than to cause the server to never start up:

==> /var/log/gitlab/nginx/current <==
2015-09-28_07:35:25.11229 nginx: [warn] conflicting server name "server" on 0.0.0.0:3123, ignored

==> /var/log/gitlab/nginx/gitlab_error.log <==
2015/09/28 08:35:43 [error] 4085#0: *1 no "ssl_certificate" is defined in server listening on SSL port while SSL handshaking, client: (my-ip), server: 0.0.0.0:3123

The second error is caused (I presume) because the first listen block in gitlab-http.conf

Any thoughts would be welcome to assist in setting this up. It could be a bug, or it could just be the fact I'm a newbie, but any assistance is welcome.

There does seem to be a solution on ServerFault however I do not know how to integrate this change.

Thanks

Assignee
Assign to
Time tracking