Source for serving and static templating/compiling of https://joshstock.in.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
51 | 04 Jan 2020 15:22 | c8140e4 | Update nginx root configuration | Josh Stockin | 1 | 4 | 2 | N |
1 | server { |
2 | listen 80; |
3 | listen [::]:80; |
4 | server_name localhost; |
5 | rewrite ^/(.*)/$ /$1 permanent; # truncate forward slash |
6 | root /var/www/html; |
7 | index index.html; |
8 | error_page 404 /error-404.html; location = /error-404.html { |
9 | root /var/www/html; |
10 | } |
11 | rewrite_log on; |
12 | location / { |
13 | try_files $uri $uri.html =404; |
14 | } |
15 | location /static { |
16 | try_files $uri =404; |
17 | } |
18 | location ~* ^\/blog\/(.*)$ { |
19 | try_files /blog-$1.html =404; |
20 | } |
21 | } |
22 |