Commit 491d674a969d05d8624676b0aa97ee02d197772d
1 parent
666cdb22
Exists in
master
and in
4 other branches
Clarify the nginx configuration.
Showing
1 changed file
with
9 additions
and
9 deletions
Show diff stats
doc/installation.md
... | ... | @@ -216,15 +216,15 @@ Application can be started with next command: |
216 | 216 | sudo -u gitlab cp config/unicorn.rb.orig config/unicorn.rb |
217 | 217 | sudo -u gitlab bundle exec unicorn_rails -c config/unicorn.rb -E production -D |
218 | 218 | |
219 | -Edit /etc/nginx/nginx.conf. Add in **http** section: | |
219 | +Edit /etc/nginx/nginx.conf. In the *http* section add: | |
220 | 220 | |
221 | 221 | upstream gitlab { |
222 | 222 | server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket; |
223 | 223 | } |
224 | 224 | |
225 | 225 | server { |
226 | - listen YOUR_SERVER_IP:80; | |
227 | - server_name gitlab.YOUR_DOMAIN.com; | |
226 | + listen YOUR_SERVER_IP:80; # e.g., listen 192.168.1.1:80; | |
227 | + server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com; | |
228 | 228 | root /home/gitlab/gitlab/public; |
229 | 229 | |
230 | 230 | # individual nginx logs for this gitlab vhost |
... | ... | @@ -232,26 +232,26 @@ Edit /etc/nginx/nginx.conf. Add in **http** section: |
232 | 232 | error_log /var/log/nginx/gitlab_error.log; |
233 | 233 | |
234 | 234 | location / { |
235 | - # serve static files from defined root folder;. | |
236 | - # @gitlab is a named location for the upstream fallback, see below | |
237 | - try_files $uri $uri/index.html $uri.html @gitlab; | |
235 | + # serve static files from defined root folder;. | |
236 | + # @gitlab is a named location for the upstream fallback, see below | |
237 | + try_files $uri $uri/index.html $uri.html @gitlab; | |
238 | 238 | } |
239 | 239 | |
240 | 240 | # if a file, which is not found in the root folder is requested, |
241 | 241 | # then the proxy pass the request to the upsteam (gitlab unicorn) |
242 | 242 | location @gitlab { |
243 | 243 | proxy_redirect off; |
244 | + | |
244 | 245 | # you need to change this to "https", if you set "ssl" directive to "on" |
245 | 246 | proxy_set_header X-FORWARDED_PROTO http; |
246 | - proxy_set_header Host gitlab.YOUR_SUBDOMAIN.com:80; | |
247 | + proxy_set_header Host $http_host; | |
247 | 248 | proxy_set_header X-Real-IP $remote_addr; |
248 | 249 | |
249 | 250 | proxy_pass http://gitlab; |
250 | 251 | } |
251 | - | |
252 | 252 | } |
253 | 253 | |
254 | -gitlab.YOUR_DOMAIN.com - change to your domain. | |
254 | +Change **YOUR_SERVER_IP** and **YOUR_SERVER_FQDN** to the IP address and fully-qualified domain name of the host serving GitLab. | |
255 | 255 | |
256 | 256 | Restart nginx: |
257 | 257 | ... | ... |