<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 16, 2015 at 11:24 PM, Nurahmadie Nurahmadie <span dir="ltr"><<a href="mailto:nurahmadie@gmail.com" target="_blank">nurahmadie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Well, in that case it's more like the whole gitlab-http server is overriding your jenkins server block.</div><div><br></div>Assuming your jenkins reverse proxy is configured like this:<div><br></div><div><span class=""><span style="font-size:12.8px">server {</span><br style="font-size:12.8px"><span style="font-size:12.8px">   listen 80;</span><br style="font-size:12.8px"><span style="font-size:12.8px">   listen [::]:80 default ipv6only=on;</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">   location /jenkins/ {</span><br style="font-size:12.8px"></span><span class=""><span style="font-size:12.8px">      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;</span><br style="font-size:12.8px"><span style="font-size:12.8px">      proxy_set_header Host $http_host;</span><br style="font-size:12.8px"></span><span style="font-size:12.8px">      proxy_pass </span><a href="http://172.17.144.123:8080/" rel="noreferrer" style="font-size:12.8px" target="_blank">http://172.17.144.123:8080</a><span style="font-size:12.8px">;</span></div></div></blockquote><div>         # make sure to remove the trailing slash here </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br style="font-size:12.8px"><span style="font-size:12.8px">   }</span><br></div><div><span style="font-size:12.8px">}</span></div><div><br></div><div><span style="font-size:12.8px">Could you add `server_name` directive over there, set it to `localhost`. and see if you can get localhost/jenkins work?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If you want to add it to the same domain with gitlab, you should set a location inside gitlab-http.conf (use `location ^~ /jenkins/` to get the highest precedence). Will get reset if you call gitlab-ctl reconfigure if you don't add it to the template.</span></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, Oct 16, 2015 at 10:56 PM, edofthemountain <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thank you for your reply.  I am not sure I understand.<br>
<br>
I do know Jenkins proxy_pass will  work if I do the following:<br>
<br>
1 -  gitlab-ctl stop<br>
2 - Comment-out the "#include gitlab-http.conf" in the nginx.conf file<br>
3 - gitlab-ctl start<br>
4 - <a href="http://localhost/jenkins" rel="noreferrer" target="_blank">http://localhost/jenkins</a> takes me to <a href="http://localhost:8081/jenkins" rel="noreferrer" target="_blank">http://localhost:8081/jenkins</a><br>
<br>
I assume this means something in gitlab-http.conf is intercpting the<br>
<a href="http://localhost/jenkins" rel="noreferrer" target="_blank">http://localhost/jenkins</a> correct?<br>
<br>
Is it likely a location directive?<br>
<br>
<br>
# This file is managed by gitlab-ctl. Manual changes will be<br>
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb<br>
# and run `sudo gitlab-ctl reconfigure`.<br>
<br>
## GitLab<br>
## Modified from<br>
<a href="https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl&" rel="noreferrer" target="_blank">https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab-ssl<br>
&</a><br>
<a href="https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab" rel="noreferrer" target="_blank">https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/support/nginx/gitlab</a><br>
##<br>
## Lines starting with two hashes (##) are comments with information.<br>
## Lines starting with one hash (#) are configuration parameters that can be<br>
uncommented.<br>
##<br>
##################################<br>
##        CHUNKED TRANSFER      ##<br>
##################################<br>
##<br>
## It is a known issue that Git-over-HTTP requires chunked transfer encoding<br>
[0]<br>
## which is not supported by Nginx < 1.3.9 [1]. As a result, pushing a large<br>
object<br>
## with Git (i.e. a single large file) can lead to a 411 error. In theory<br>
you can get<br>
## around this by tweaking this configuration file and either:<br>
## - installing an old version of Nginx with the chunkin module [2] compiled<br>
in, or<br>
## - using a newer version of Nginx.<br>
##<br>
## At the time of writing we do not know if either of these theoretical<br>
solutions works.<br>
## As a workaround users can use Git over SSH to push large files.<br>
##<br>
## [0]<br>
<a href="https://git.kernel.org/cgit/git/git.git/tree/Documentation/technical/http-protocol.txt#n99" rel="noreferrer" target="_blank">https://git.kernel.org/cgit/git/git.git/tree/Documentation/technical/http-protocol.txt#n99</a><br>
## [1] <a href="https://github.com/agentzh/chunkin-nginx-module#status" rel="noreferrer" target="_blank">https://github.com/agentzh/chunkin-nginx-module#status</a><br>
## [2] <a href="https://github.com/agentzh/chunkin-nginx-module" rel="noreferrer" target="_blank">https://github.com/agentzh/chunkin-nginx-module</a><br>
##<br>
###################################<br>
##         configuration         ##<br>
###################################<br>
<br>
upstream gitlab {<br>
  server unix:/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket<br>
fail_timeout=0;<br>
}<br>
<br>
upstream gitlab-git-http-server {<br>
  server unix:/var/opt/gitlab/gitlab-git-http-server/socket;<br>
}<br>
<br>
<br>
server {<br>
  listen *:80;<br>
<br>
<br>
  server_name <a href="http://gitlab.monserver.fr" rel="noreferrer" target="_blank">gitlab.monserver.fr</a>;<br>
  server_tokens off; ## Don't show the nginx version number, a security best<br>
practice<br>
  root /opt/gitlab/embedded/service/gitlab-rails/public;<br>
<br>
  ## Increase this if you want to upload large attachments<br>
  ## Or if you want to accept large git objects over http<br>
  client_max_body_size 250m;<br>
<br>
<br>
  ## Individual nginx logs for this GitLab vhost<br>
  access_log  /var/log/gitlab/nginx/gitlab_access.log gitlab_access;<br>
  error_log   /var/log/gitlab/nginx/gitlab_error.log;<br>
<br>
  location / {<br>
    ## Serve static files from defined root folder.<br>
    ## @gitlab is a named location for the upstream fallback, see below.<br>
    try_files $uri $uri/index.html $uri.html @gitlab;<br>
  }<br>
<br>
  location /uploads/ {<br>
    ## If you use HTTPS make sure you disable gzip compression<br>
    ## to be safe against BREACH attack.<br>
<br>
<br>
    ## <a href="https://github.com/gitlabhq/gitlabhq/issues/694" rel="noreferrer" target="_blank">https://github.com/gitlabhq/gitlabhq/issues/694</a><br>
    ## Some requests take more than 30 seconds.<br>
    proxy_read_timeout      300;<br>
    proxy_connect_timeout   300;<br>
    proxy_redirect          off;<br>
<br>
    proxy_set_header    Host                $http_host;<br>
    proxy_set_header    X-Real-IP           $remote_addr;<br>
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;<br>
    proxy_set_header    X-Forwarded-Proto   http;<br>
    proxy_set_header    X-Frame-Options     SAMEORIGIN;<br>
<br>
    proxy_pass <a href="http://gitlab" rel="noreferrer" target="_blank">http://gitlab</a>;<br>
  }<br>
<br>
  ## If a file, which is not found in the root folder is requested,<br>
  ## then the proxy passes the request to the upsteam (gitlab unicorn).<br>
  location @gitlab {<br>
    ## If you use HTTPS make sure you disable gzip compression<br>
    ## to be safe against BREACH attack.<br>
<br>
<br>
    ## <a href="https://github.com/gitlabhq/gitlabhq/issues/694" rel="noreferrer" target="_blank">https://github.com/gitlabhq/gitlabhq/issues/694</a><br>
    ## Some requests take more than 30 seconds.<br>
    proxy_read_timeout      300;<br>
    proxy_connect_timeout   300;<br>
    proxy_redirect          off;<br>
<br>
    proxy_set_header    Host                $http_host;<br>
    proxy_set_header    X-Real-IP           $remote_addr;<br>
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;<br>
    proxy_set_header    X-Forwarded-Proto   http;<br>
    proxy_set_header    X-Frame-Options     SAMEORIGIN;<br>
<br>
    proxy_pass <a href="http://gitlab" rel="noreferrer" target="_blank">http://gitlab</a>;<br>
  }<br>
<br>
  location ~ [-\/\w\.]+\.git\/ {<br>
    ## If you use HTTPS make sure you disable gzip compression<br>
    ## to be safe against BREACH attack.<br>
<br>
<br>
    ## <a href="https://github.com/gitlabhq/gitlabhq/issues/694" rel="noreferrer" target="_blank">https://github.com/gitlabhq/gitlabhq/issues/694</a><br>
    ## Some requests take more than 30 seconds.<br>
    proxy_read_timeout      300;<br>
    proxy_connect_timeout   300;<br>
    proxy_redirect          off;<br>
<br>
    proxy_set_header    Host                $http_host;<br>
    proxy_set_header    X-Real-IP           $remote_addr;<br>
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;<br>
    proxy_set_header    X-Forwarded-Proto   http;<br>
<br>
    proxy_pass <a href="http://gitlab-git-http-server" rel="noreferrer" target="_blank">http://gitlab-git-http-server</a>;<br>
  }<br>
<br>
  ## Enable gzip compression as per rails guide:<br>
  ## <a href="http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression" rel="noreferrer" target="_blank">http://guides.rubyonrails.org/asset_pipeline.html#gzip-compression</a><br>
  ## WARNING: If you are using relative urls remove the block below<br>
  ## See config/application.rb under "Relative url support" for the list of<br>
  ## other files that need to be changed for relative url support<br>
  location ~ ^/(assets)/ {<br>
    root /opt/gitlab/embedded/service/gitlab-rails/public;<br>
    gzip_static on; # to serve pre-gzipped version<br>
    expires max;<br>
    add_header Cache-Control public;<br>
  }<br>
<br>
<br>
  error_page 502 /502.html;<br>
<br>
<br>
}<br>
<br>
Posted at Nginx Forum: <a href="https://forum.nginx.org/read.php?2,262255,262282#msg-262282" rel="noreferrer" target="_blank">https://forum.nginx.org/read.php?2,262255,262282#msg-262282</a><br>
<div><div><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>regards,<br>Nurahmadie<br>--<br></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">regards,<br>Nurahmadie<br>--<br></div>
</div></div>