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