home · contact · privacy
5d95d2e4aefe478b79fd0b9c0d2d623f4d5c35ec
[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 # is expected even if empty
7 events {
8 }
9
10 http {
11     # define content-type headers
12     types {
13         text/html html htm shtml;
14         text/css css;
15         text/xml xml;
16         text/plain txt sh rst md;
17         application/xhtml+xml xhtml;
18         application/pdf pdf;
19         image/jpeg jpg jpeg;
20         image/png png;
21     }
22     default_type application/octet_stream;
23     charset utf-8;
24
25     # logging deactivated due to GDPR
26     #access_log /var/log/nginx/access.log;
27     #error_log /var/log/nginx/error.log;
28
29     # HTTP server: only enforce HTTPS
30     server {
31         listen 80;
32         return 301 https://$host$request_uri;
33     }
34
35     # HTTPS server
36     server {
37         listen 443 ssl;
38         server_name REPLACE_fqdn_ECALPER;
39         ssl_certificate /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/fullchain.pem;
40         ssl_certificate_key /etc/letsencrypt/live/REPLACE_fqdn_ECALPER/privkey.pem;
41         root /var/www/html/;
42         index index.html index.htm index.nginx-debian.html;
43
44         # serve /var/www/public_repos/* for HTTPS git cloning
45         location ~ /repos/clone(/.*) {
46             include fastcgi_params;
47             fastcgi_param SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
48             fastcgi_param GIT_HTTP_EXPORT_ALL "";
49             fastcgi_param GIT_PROJECT_ROOT /var/public_repos;
50             fastcgi_param PATH_INFO $1;
51             fastcgi_pass unix:/var/run/fcgiwrap.socket;
52         }
53
54         # gitweb static files
55         location /repos/static/ {
56             alias /usr/share/gitweb/static/;
57         }
58
59         # gitweb; this needs packages fcgiwrap and gitweb
60         location /repos/ {
61             include fastcgi_params;
62             fastcgi_param SCRIPT_FILENAME /usr/share/gitweb/gitweb.cgi;
63             fastcgi_param GITWEB_CONFIG /etc/gitweb.conf;
64             fastcgi_pass unix:/var/run/fcgiwrap.socket;
65         }
66     }
67 }