home · contact · privacy
Use XSLT stylesheet for IRClogs root autoindex.
[config] / all_new_2018 / linkable_etc_files / web / etc / nginx / nginx.conf
1 # system integration
2 user www-data;
3 worker_processes auto;
4 pid /run/nginx.pid;
5
6 # we need this for the xslt_stylesheet directive below
7 load_module modules/ngx_http_xslt_filter_module.so;
8
9 # is expected even if empty
10 events {
11 }
12
13 http {
14     # define content-type headers
15     types {
16         text/html html htm shtml;
17         text/css css;
18         text/xml xml;
19         text/plain txt sh rst md;
20         application/xhtml+xml xhtml;
21         application/pdf pdf;
22         image/jpeg jpg jpeg;
23         image/png png;
24     }
25     default_type application/octet_stream;
26     charset utf-8;
27
28     # logging deactivated due to GDPR
29     #access_log /var/log/nginx/access.log;
30     #error_log /var/log/nginx/error.log;
31
32     # HTTP server: only enforce HTTPS
33     server {
34         listen 80;
35         return 301 https://$host$request_uri;
36     }
37
38     # HTTPS server
39     server {
40         listen 443 ssl;
41         server_name REPLACE_fqdn_ECALPER;
42         ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
43         ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
44         root /var/www/html/;
45         index index.html index.htm index.nginx-debian.html;
46
47         # serve /var/www/public_repos/* for HTTPS git cloning
48         location ~ /repos/clone(/.*) {
49             include fastcgi_params;
50             fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
51             fastcgi_param GIT_HTTP_EXPORT_ALL "";
52             fastcgi_param GIT_PROJECT_ROOT /var/public_repos;
53             fastcgi_param PATH_INFO $1;
54             fastcgi_pass unix:/var/run/fcgiwrap.socket;
55         }
56
57         # gitweb static files
58         location /repos/static/ {
59             alias /usr/share/gitweb/static/;
60         }
61
62         # gitweb; this needs packages fcgiwrap and gitweb
63         location /repos/ {
64             include fastcgi_params;
65             fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi;
66             fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
67             fastcgi_pass unix:/var/run/fcgiwrap.socket;
68         }
69
70         # login-protected IRC logs
71         location ~ /irclogs/([^/]+)/ {
72             auth_basic "$1 logs";
73             auth_basic_user_file /var/www/irclogs_pw/$1;
74             autoindex on;
75         }
76
77         # entry for IRC logs
78         location /irclogs/ {
79             autoindex on;
80             autoindex_format xml;
81             xslt_stylesheet /var/www/autoindex.xslt
82         }
83     }
84 }