summaryrefslogtreecommitdiff
path: root/lib/support/nginx
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2015-02-20 15:47:34 -0800
committerMarin Jankovski <maxlazio@gmail.com>2015-02-20 15:47:34 -0800
commit51349ca3c83c56e072f87253d375316f7164b49a (patch)
tree0318216cc50a6a9b026a1b04cbffbe6b251fd739 /lib/support/nginx
parentb180476bd69bdf99b1727b041116fa8447c0201f (diff)
parent2c9b35732409c2a73150788067e1b03b91101f39 (diff)
downloadgitlab-ce-51349ca3c83c56e072f87253d375316f7164b49a.tar.gz
Merge branch 'go-get-workaround-nginx' of https://github.com/mattes/gitlabhq into mattes-go-get-workaround-nginx
Conflicts: lib/support/nginx/gitlab lib/support/nginx/gitlab-ssl
Diffstat (limited to 'lib/support/nginx')
-rw-r--r--lib/support/nginx/gitlab10
-rw-r--r--lib/support/nginx/gitlab-ssl10
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/support/nginx/gitlab b/lib/support/nginx/gitlab
index 62a4276536c..fd5b2664786 100644
--- a/lib/support/nginx/gitlab
+++ b/lib/support/nginx/gitlab
@@ -77,6 +77,16 @@ server {
proxy_pass http://gitlab;
}
+ ## If ``go get`` detected, return go-import meta tag.
+ ## This works for public and for private repositories.
+ ## See also http://golang.org/cmd/go/#hdr-Remote_import_paths
+ if ($http_user_agent ~* "Go") {
+ return 200 "
+ <!DOCTYPE html>
+ <head><meta content='$host$uri git $scheme://$host$uri.git' name='go-import'></head>
+ </html>";
+ }
+
## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (gitlab unicorn).
location @gitlab {
diff --git a/lib/support/nginx/gitlab-ssl b/lib/support/nginx/gitlab-ssl
index 2aefc944698..a9699bac611 100644
--- a/lib/support/nginx/gitlab-ssl
+++ b/lib/support/nginx/gitlab-ssl
@@ -123,6 +123,16 @@ server {
proxy_pass http://gitlab;
}
+ ## If ``go get`` detected, return go-import meta tag.
+ ## This works for public and for private repositories.
+ ## See also http://golang.org/cmd/go/#hdr-Remote_import_paths
+ if ($http_user_agent ~* "Go") {
+ return 200 "
+ <!DOCTYPE html>
+ <head><meta content='$host$uri git $scheme://$host$uri.git' name='go-import'></head>
+ </html>";
+ }
+
## If a file, which is not found in the root folder is requested,
## then the proxy passes the request to the upsteam (gitlab unicorn).
location @gitlab {