Advertisement
Matancy

Untitled

Jul 6th, 2018
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. # This configuration has been tested on GitLab 8.2
  2. # Note this config assumes unicorn is listening on default port 8080 and
  3. # gitlab-workhorse is listening on port 8181. To allow gitlab-workhorse to
  4. # listen on port 8181, edit or create /etc/default/gitlab and change or add the following:
  5. #
  6. # gitlab_workhorse_options="-listenUmask 0 -listenNetwork tcp -listenAddr 127.0.0.1:8181 -authBackend http://127.0.0.1:8080"
  7. #
  8. #Module dependencies
  9. # mod_rewrite
  10. # mod_proxy
  11. # mod_proxy_http
  12. <VirtualHost *>
  13. ServerName gitlab.cpmtech.fr
  14. ServerSignature Off
  15.  
  16. ProxyPreserveHost On
  17.  
  18. # Ensure that encoded slashes are not decoded but left in their encoded state.
  19. # http://doc.gitlab.com/ce/api/projects.html#get-single-project
  20. AllowEncodedSlashes NoDecode
  21.  
  22. <Location />
  23. # New authorization commands for apache 2.4 and up
  24. # http://httpd.apache.org/docs/2.4/upgrading.html#access
  25. Require all granted
  26.  
  27. #Allow forwarding to gitlab-workhorse
  28.  
  29. ProxyPass http://127.0.0.1:9191
  30.  
  31. # ProxyPassReverse http://127.0.0.1:8123
  32. ProxyPassReverse http://gitlab.cpmtech.fr/
  33. </Location>
  34.  
  35. # Apache equivalent of nginx try files
  36. # http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
  37. # http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
  38. RewriteEngine on
  39.  
  40. #Forward all requests to gitlab-workhorse except existing files like error documents
  41. RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
  42. RewriteCond %{REQUEST_URI} ^/uploads/.*
  43. RewriteRule .* http://127.0.0.1:8123%{REQUEST_URI} [P,QSA,NE]
  44.  
  45. # needed for downloading attachments
  46. DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
  47.  
  48. #Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
  49. ErrorDocument 404 /404.html
  50. ErrorDocument 422 /422.html
  51. ErrorDocument 500 /500.html
  52. ErrorDocument 502 /502.html
  53. ErrorDocument 503 /503.html
  54.  
  55. # It is assumed that the log directory is in /var/log/httpd.
  56. # For Debian distributions you might want to change this to
  57. # /var/log/apache2.
  58. LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
  59. ErrorLog /var/log/apache2/cpmtech_error.log
  60. CustomLog /var/log/apache2/cpmtech_forwarded.log common_forwarded
  61. CustomLog /var/log/apache2/cpmtech_access.log combined env=!dontlog
  62. CustomLog /var/log/apache2/cpmtech.log combined
  63.  
  64. </VirtualHost>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement