diff options
author | Jesús <heckyel@hyperbola.info> | 2021-05-23 16:04:01 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-05-23 16:04:01 -0500 |
commit | 764a1cbb69d7319f361ee49b6f6a2bf297daff14 (patch) | |
tree | c678898f6eb43529ae55ddc7083fefbac4b1d23b | |
parent | 64bc0e7de3fd3c540f5e8f1671ad6de3aa3c2d96 (diff) | |
download | gitolite-cgit-docker-764a1cbb69d7319f361ee49b6f6a2bf297daff14.tar.lz gitolite-cgit-docker-764a1cbb69d7319f361ee49b6f6a2bf297daff14.tar.xz gitolite-cgit-docker-764a1cbb69d7319f361ee49b6f6a2bf297daff14.zip |
Fix nginx configuration
```
location ~* ^.+\.(css|png|ico)$ {
expires 30d;
}
```
^ that parameter causes that .css files cannot be explored
-rwxr-xr-x | gitolite-cgit/entrypoint.sh | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/gitolite-cgit/entrypoint.sh b/gitolite-cgit/entrypoint.sh index dce674e..3bd33c2 100755 --- a/gitolite-cgit/entrypoint.sh +++ b/gitolite-cgit/entrypoint.sh @@ -199,19 +199,34 @@ EOF root /usr/share/webapps/cgit; try_files \$uri @cgit; - location ~* ^.+\.(css|png|ico)$ { - expires 30d; - } + location @cgit { + include fastcgi_params; + + # Path to the CGI script that comes with cgit + fastcgi_param SCRIPT_FILENAME \$document_root/cgit.cgi; - location / { - index cgit.cgi; - fastcgi_param SCRIPT_FILENAME \$document_root/cgit.cgi; - fastcgi_pass unix:/run/fcgiwrap/fcgiwrap.socket; - fastcgi_param HTTP_HOST \$server_name; - fastcgi_param PATH_INFO \$uri; - fastcgi_param QUERY_INFO \$uri; - include "fastcgi_params"; + fastcgi_param PATH_INFO \$uri; + fastcgi_param QUERY_STRING \$args; + fastcgi_param QUERY_INFO \$uri; + fastcgi_param HTTP_HOST \$server_name; + + # Path to the socket file that is created/used by fcgiwrap + fastcgi_pass unix:/run/fcgiwrap/fcgiwrap.socket; } + + # Enable compression for JS/CSS/HTML, for improved client load times. + # It might be nice to compress JSON/XML as returned by the API, but + # leaving that out to protect against potential BREACH attack. + gzip on; + gzip_vary on; + + gzip_types # text/html is always compressed by HttpGzipModule + text/css + application/javascript + font/truetype + font/opentype + application/vnd.ms-fontobject + image/svg+xml; } EOF |