diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2015-10-30 02:44:26 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-10-30 12:48:53 +0100 |
commit | bd525cbda9c874823e3384227dcc8a1cb0dea35f (patch) | |
tree | 5b10d2709685ad2e4ffe071fed48aafaf799e2b0 /roles/git/files/etc/nginx | |
parent | 5e72af08d3b98b08167595b1d0ceb9d0a75c7375 (diff) |
nginx: adjust expiration date for static content.
Diffstat (limited to 'roles/git/files/etc/nginx')
-rw-r--r-- | roles/git/files/etc/nginx/sites-available/git | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/roles/git/files/etc/nginx/sites-available/git b/roles/git/files/etc/nginx/sites-available/git index 75c1512..112babb 100644 --- a/roles/git/files/etc/nginx/sites-available/git +++ b/roles/git/files/etc/nginx/sites-available/git @@ -1,40 +1,41 @@ server { listen 80; listen [::]:80; server_name git.fripost.org; access_log /var/log/nginx/git.access.log; error_log /var/log/nginx/git.error.log info; location ^~ /static/ { alias /usr/share/cgit/; expires 30d; } # Bypass the CGI to return static files stored on disk. Try first repo with # a trailing '.git', then without. location ~* "^/((?U)[^/]+)(?:\.git)?/objects/(?:[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\.(?:pack|idx))$" { root /var/lib/gitolite/repositories; try_files /$1.git/objects/$2 /$1/objects/$2 =404; expires 30d; + gzip off; # TODO honor git-daemon-export-ok } # disallow push over HTTP/HTTPS location ~* "^/[^/]+/git-receive-pack$" { return 403; } location ~* "^/[^/]+/(?:HEAD|info/refs|objects/info/[^/]+|git-upload-pack)$" { gzip off; include uwsgi_params; uwsgi_modifier1 9; uwsgi_param GIT_PROJECT_ROOT /var/lib/gitolite/repositories; uwsgi_pass unix:/run/uwsgi/app/git-http-backend/socket; } # send all other URLs to cgit location / { gzip off; include uwsgi_params; uwsgi_modifier1 9; @@ -50,40 +51,41 @@ server { server_name git.fripost.org; include ssl/config; ssl_certificate /etc/nginx/ssl/git.fripost.org.pem; ssl_certificate_key /etc/nginx/ssl/git.fripost.org.key; access_log /var/log/nginx/git.access.log; error_log /var/log/nginx/git.error.log info; location ^~ /static/ { alias /usr/share/cgit/; expires 30d; } # Bypass the CGI to return static files stored on disk. Try first repo with # a trailing '.git', then without. location ~* "^/((?U)[^/]+)(?:\.git)?/objects/(?:[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\.(?:pack|idx))$" { root /var/lib/gitolite/repositories; try_files /$1.git/objects/$2 /$1/objects/$2 =404; expires 30d; + gzip off; # TODO honor git-daemon-export-ok } # disallow push over HTTP/HTTPS location ~* "^/[^/]+/git-receive-pack$" { return 403; } location ~* "^/[^/]+/(?:HEAD|info/refs|objects/info/[^/]+|git-upload-pack)$" { gzip off; include uwsgi_params; uwsgi_modifier1 9; uwsgi_param GIT_PROJECT_ROOT /var/lib/gitolite/repositories; uwsgi_pass unix:/run/uwsgi/app/git-http-backend/socket; } # send all other URLs to cgit location / { gzip off; include uwsgi_params; uwsgi_modifier1 9; |