Diff options
Diffstat (limited to '')
| -rw-r--r-- | custom/servers/apache.conf | 49 |
1 file changed, 20 insertions, 29 deletions
diff --git a/custom/servers/apache.conf b/custom/servers/apache.conf index 7778c7f..3d65d5e 100644 --- a/custom/servers/apache.conf +++ b/custom/servers/apache.conf @@ -17,16 +17,14 @@ # cgit CGI binary /usr/lib/cgit/cgit.cgi # static assets /usr/share/cgit (cgit.css cgit.js cgit.png favicon.ico robots.txt) # cgit config /etc/cgitrc -# public URL https://git.example.org/ (cgit at the domain root) +# public url https://git.example.org/ (cgit at the domain root) # # cgit is one CGI executable. It learns the repository and the page from -# PATH_INFO and reads page options such as h= and id= from QUERY_STRING. -# ScriptAlias runs the binary and forwards the trailing path as PATH_INFO, so -# no extra path tuning is needed. cgit builds its own link base from -# SCRIPT_NAME. The five static assets are served straight off disk. mod_alias -# resolves Alias and ScriptAlias in order and the first match wins, so the -# static Alias lines come before the catch-all ScriptAlias to stop the two -# routes from shadowing each other. +# PATH_INFO and reads page options such as h= and id= from QUERY_STRING. The +# five static assets are served straight off disk. mod_alias resolves Alias and +# ScriptAlias in order and the first match wins, so the static Alias lines come +# before the catch-all ScriptAlias to stop the two routes from shadowing each +# other. # ServerRoot is what every relative path below resolves against, including the @@ -138,8 +136,8 @@ AddType text/plain .txt Require all granted # These assets rarely change, so let browsers cache them. Keep the - # caching scoped to this directory. Ordinary cgit pages carry no caching - # headers, so a server-wide ExpiresDefault would stamp freshness onto + # caching scoped to this directory. Ordinary cgit pages carry no expiry + # time, so a server-wide ExpiresDefault would stamp freshness onto # them, fight the no-store cgit puts on the login page, and could let # one visitor's page be served to another from a shared cache. <IfModule mod_expires.c> @@ -150,7 +148,6 @@ AddType text/plain .txt # The cgit binary. <Directory "/usr/lib/cgit"> - # Allow CGI execution here. Options +ExecCGI # Run cgit.cgi as a CGI even if it is ever reached through a plain Alias # rather than ScriptAlias. @@ -204,13 +201,8 @@ AddType text/plain .txt LimitRequestBody 65536 # Site-wide security headers are set here so they also cover the static - # assets Apache serves. cgit itself sends only the headers the proxy - # cannot supply. Those are Status, Content-Type, Content-Length and - # Content-Disposition on downloads, Location on redirects, a Cache-Control - # marking the login page no-store and a page behind an auth filter private, - # the auth filter's Set-Cookie, and on raw repository bytes a nosniff of - # its own next to the stricter policy "default-src 'none'". Everything - # else, this policy included, is the proxy's job. + # assets Apache serves. On raw repository bytes cgit sends a nosniff and + # the stricter policy "default-src 'none'" of its own. # # The word setifempty is load bearing on the two headers cgit can also # emit. "Header always set" replaces a same-named header even when the @@ -248,23 +240,22 @@ AddType text/plain .txt # once browsers have seen it. Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains" - # These five files are the only things served off disk. cgit.css and - # cgit.js are the paths cgit's HTML points at by default, so if you - # relocate the assets update both these Alias targets and the css, js, - # logo and favicon settings in cgitrc to agree. + # These five files are the only things served off disk. cgit's default + # css, js, logo and favicon settings point at these paths, so if you + # relocate the assets update both these Alias targets and those settings + # in cgitrc to agree. Alias /cgit.css /usr/share/cgit/cgit.css Alias /cgit.js /usr/share/cgit/cgit.js Alias /cgit.png /usr/share/cgit/cgit.png Alias /favicon.ico /usr/share/cgit/favicon.ico Alias /robots.txt /usr/share/cgit/robots.txt - # ScriptAlias maps a URL prefix to a path, marks it executable, and - # forwards the rest of the URL as PATH_INFO. Mapping / makes cgit the - # handler for every URL the static Aliases above did not already claim. - # The trailing slash on cgit.cgi/ is load bearing, telling Apache that - # cgit.cgi is the program and the rest of the URL is PATH_INFO. cgit - # derives its link base from SCRIPT_NAME, which at the domain root is / - # and needs no tuning. For a sub-path install see the note below. + # Mapping / makes cgit the handler for every url the static Aliases above + # did not already claim. The trailing slash on cgit.cgi/ is load bearing, + # telling Apache that cgit.cgi is the program and the rest of the url is + # PATH_INFO. cgit derives its link base from SCRIPT_NAME, which at the + # domain root is / and needs no tuning. For a sub-path install see the + # note below. ScriptAlias / /usr/lib/cgit/cgit.cgi/ </VirtualHost> |
