home · contact · privacy
07d6bdebf7e80f38f8cb078185ff593ea9521cc4
[config] / systemfiles / nginx.conf
1 # system integration
2 user www-data;
3 pid /run/nginx.pid;
4
5 # is expected even if empty
6 events {
7 }
8
9 http {
10         # define content-type headers
11         types {
12             text/html                             html htm shtml;
13             text/css                              css;
14             text/xml                              xml;
15             text/plain                            txt sh rst md;
16             application/xhtml+xml                 xhtml;
17             application/pdf                       pdf;
18             image/jpeg                            jpg jpeg;
19             image/png                             png;
20         }
21         default_type application/octet_stream;
22         charset utf-8;
23
24         # logging
25         access_log /var/log/nginx/access.log;
26         error_log /var/log/nginx/error.log;
27
28         # enforce https
29         server {
30                 listen 80;
31                 return 301 https://$host$request_uri;
32         }
33
34         # IRC logs
35         server {
36                 listen 443 ssl;
37                 server_name dump.plomlompom.com;
38                 ssl_certificate /etc/letsencrypt/live/dump.plomlompom.com/fullchain.pem;
39                 ssl_certificate_key /etc/letsencrypt/live/dump.plomlompom.com/privkey.pem;
40                 root /var/www/html/;
41                 location /zettel/ {
42                         rewrite ^(/zettel/(.*/)*[^./]+)$ $1.html;
43                         autoindex on;
44                 }
45                 location /dump/ {
46                         autoindex on;
47                 }
48                 location /geheim/ {
49                         auth_basic "geheim geheim";
50                         auth_basic_user_file /var/www/password_geheim;
51                         autoindex on;
52                 }
53                 location /irclogs/zrolaps/ {
54                         auth_basic "#zrolaps logs";
55                         auth_basic_user_file /var/www/password_irclogs_zrolaps;
56                         autoindex on;
57                 }
58                 location /irclogs/nodrama.de/ {
59                         auth_basic "#nodrama.de logs";
60                         auth_basic_user_file /var/www/password_irclogs_nodrama_de;
61                         autoindex on;
62                 }
63                 location /irclogs/freakazoid/ {
64                         auth_basic "#freakazoid logs";
65                         auth_basic_user_file /var/www/password_irclogs_freakazoid;
66                         autoindex on;
67                 }
68                 location /lesekreis/ {
69                         auth_basic "Quellen Lesekreis";
70                         auth_basic_user_file /var/www/password_lesekreis;
71                         autoindex on;
72                 }
73         }
74
75         # htwtxt
76         server {
77                 listen 443 ssl;
78                 server_name htwtxt.plomlompom.com;
79                 ssl_certificate /etc/letsencrypt/live/htwtxt.plomlompom.com/fullchain.pem;
80                 ssl_certificate_key /etc/letsencrypt/live/htwtxt.plomlompom.com/privkey.pem;
81                 location / {
82                         proxy_pass http://127.0.0.1:8000;
83                 }
84         }
85 }