{"id":15808,"date":"2018-10-08T16:08:35","date_gmt":"2018-10-08T16:08:35","guid":{"rendered":"https:\/\/blog.taragana.com\/?p=15808"},"modified":"2018-10-14T12:18:08","modified_gmt":"2018-10-14T12:18:08","slug":"how-to-run-gogs-behind-haproxy-serving-https-ssl-tls-connections","status":"publish","type":"post","link":"https:\/\/blog.taragana.com\/how-to-run-gogs-behind-haproxy-serving-https-ssl-tls-connections-15808","title":{"rendered":"How to run Gogs behind HAProxy serving https (SSL\/TLS) connections"},"content":{"rendered":"\n

I run Gogs in a LXD container which runs behind HAProxy in another LXD container. HAProxy handles SSL\/TLS connection (SSL Termination).<\/p>\n\n\n\n

Note: Gogs is a Git service like GitHub or GitLabs. It is written in Go and normally used to host your own git server along with GitHub like interface and functionality (for free).<\/p>\n\n\n\n

As you know, Gogs normally starts on non-standard ports so it doesn’t need super-user access. The following is a sample configuration ( custom\/conf\/app.ini ) for Gogs running internally on HTTP port 3000 while being served by a regular HTTPS URL (running on regular HTTPS port where SSL\/TLS termination is provided by HAProxy):<\/p>\n\n\n\n

[server]\nDOMAIN           = gogs-domain.comHTTP_PORT        = 3000ROOT_URL         = https<\/strong>:\/\/gogs-domain.com\/DISABLE_SSH      = falseSSH_PORT         = 3333\nSTART_SSH_SERVER = false\nOFFLINE_MODE     = false<\/pre>\n","protected":false},"excerpt":{"rendered":"

I run Gogs in a LXD container which runs behind HAProxy in another LXD container. HAProxy handles SSL\/TLS connection (SSL Termination). Note: Gogs is a Git service like GitHub or GitLabs. It is written in Go and normally used to host your own git server along with GitHub like interface and functionality (for free). As […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[39,45,46,135,136,137,138,139],"_links":{"self":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/15808"}],"collection":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/comments?post=15808"}],"version-history":[{"count":4,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/15808\/revisions"}],"predecessor-version":[{"id":15812,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/posts\/15808\/revisions\/15812"}],"wp:attachment":[{"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/media?parent=15808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/categories?post=15808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.taragana.com\/wp-json\/wp\/v2\/tags?post=15808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}