Skip to content
11 changes: 11 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ http {
index index.html;
error_page 404 /404.html;

location ~ \.md$ {
# Strip .md extension and proxy to origin with Accept: text/markdown header
rewrite ^(.*)\.md$ $1 break;
proxy_pass https://$http_host$uri;
proxy_set_header Accept "text/markdown";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}

location / {
rewrite ^/(.*)/$ /$1 permanent;
try_files $uri $uri.html $uri/index.html =404;
Expand Down
Loading