replace if statement with try_files in nginx.conf
http://wiki.nginx.org/IfIsEvil
This commit is contained in:
parent
039b6db483
commit
e6153beda8
1 changed files with 5 additions and 9 deletions
|
@ -220,15 +220,11 @@ Edit /etc/nginx/nginx.conf. Add next code to **http** section:
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name mygitlab.com;
|
server_name mygitlab.com;
|
||||||
|
|
||||||
location / {
|
|
||||||
|
|
||||||
root /home/gitlab/gitlab/public;
|
root /home/gitlab/gitlab/public;
|
||||||
|
try_files $uri $uri/index.html $uri.html @gitlab;
|
||||||
|
|
||||||
if (!-f $request_filename) {
|
location @gitlab {
|
||||||
proxy_pass http://gitlab;
|
proxy_pass http://gitlab;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue