summaryrefslogtreecommitdiff
path: root/aux/nginx.conf
blob: 5bd4f6a5107a1d7c944e3e1dc8b6c5d520dd1afa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- Mode: nginx -*-

server {
	server_name www.lukeshu.com;
	listen 443 ssl http2;
	listen [::]:443 ssl http2;

	error_log  /var/log/nginx/http.www_lukeshu_com.error.log  error;
	access_log /var/log/nginx/http.www_lukeshu_com.access.log combined;

	# Main
	location / {
		index index.html;
		charset utf-8;
		location /dump/ {
			location /dump/rfc7235 {
				auth_basic "Restricted";
				auth_basic_user_file /dev/null;
			}
			location ~ /dump/.*\.d/ {
				autoindex on;
			}
		}
		location /avatar/ {
			try_files $uri.png =404;
		}
	}

	# Legacy
	location /git {
		location /git                   { rewrite ^/git(/.*)?$       https://git.lukeshu.com$1$is_args$args? permanent; }
		location /git/mirror/dotfiles   { rewrite ^/git/mirror/(.*)$ https://git.lukeshu.com/$1$is_args$args? permanent; }
		location /git/mirror/thingutils { rewrite ^/git/mirror/(.*)$ https://git.lukeshu.com/$1$is_args$args? permanent; }
	}
	location /donate.html { return 301 /sponsor/; }
}