Source for serving and static templating/compiling of https://joshstock.in.
{#} | Time | Hash | Subject | Author | # | (+) | (-) | GPG? |
---|---|---|---|---|---|---|---|---|
38 | 02 Jan 2020 16:42 | 07297ad | Streamline nginx configuration updates | Josh Stockin | 1 | 19 | 0 | 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; |
9 | rewrite_log on; |
10 | location / { |
11 | try_files $uri $uri/ $uri.html =404; |
12 | } |
13 | location /static { |
14 | try_files $uri =404; |
15 | } |
16 | location ~* ^\/blog\/(.*)$ { |
17 | try_files /blog-$1.html =404; |
18 | } |
19 | } |
20 |