Commit c8f2b9cfeb2747b0b6f55405036275abe6380c71
1 parent
8ee0993f
Exists in
master
and in
4 other branches
added nginx access_log; error_log directives for easier debugging vhost errors
added proxy_set_header directives to prevent "ssl_error_rx_record_too_long" added subdomain "gitlab.YOUR_SUBDOMAIN.com" to server_name directive added "YOUR_SERVER_IP" to listen directive
Showing
1 changed file
with
19 additions
and
2 deletions
Show diff stats
doc/installation.md
... | ... | @@ -223,12 +223,29 @@ Edit /etc/nginx/nginx.conf. Add next code to **http** section: |
223 | 223 | } |
224 | 224 | |
225 | 225 | server { |
226 | - listen 80; | |
227 | - server_name mygitlab.com; | |
226 | + listen YOUR_SERVER_IP:80; | |
227 | + server_name gitlab.YOUR_SUBDOMAIN.com; | |
228 | 228 | root /home/gitlab/gitlab/public; |
229 | + | |
230 | + # individual nginx logs for this gitlab vhost | |
231 | + access_log /var/log/nginx/gitlab_access.log; | |
232 | + error_log /var/log/nginx/gitlab_error.log; | |
233 | + | |
234 | + location / { | |
235 | + # serve static files from defined root folder;. | |
236 | + # @gitlab is a named location for the upstream fallback, see below | |
229 | 237 | try_files $uri $uri/index.html $uri.html @gitlab; |
238 | + } | |
230 | 239 | |
240 | + # if a file, which is not found in the root folder is requested, | |
241 | + # then the proxy pass the request to the upsteam (gitlab unicorn) | |
231 | 242 | location @gitlab { |
243 | + proxy_redirect off; | |
244 | + # you need to change this to "https", if you set "ssl" directive to "on" | |
245 | + proxy_set_header X-FORWARDED_PROTO http; | |
246 | + proxy_set_header Host gitlab.YOUR_SUBDOMAIN.com:80; | |
247 | + proxy_set_header X-Real-IP $remote_addr; | |
248 | + | |
232 | 249 | proxy_pass http://gitlab; |
233 | 250 | } |
234 | 251 | ... | ... |