38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
# minimal standalone nginx config for development
|
|
# sufficient to serve a capybara-generated site tree
|
|
|
|
daemon off;
|
|
master_process off;
|
|
error_log /dev/stderr info;
|
|
pid /tmp/nginx-capybara.pid;
|
|
|
|
events {}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
charset UTF-8;
|
|
types_hash_max_size 4096;
|
|
access_log /dev/stdout;
|
|
gzip on;
|
|
|
|
map $http_user_agent $mathjax_polyfill {
|
|
default "<script type='text/javascript' src='https://www.unpkg.com/mathjax@3.2.0/es5/tex-mml-chtml.js'></script><script type='text/javascript'>async function brave_test() {if((navigator.brave && await navigator.brave.isBrave() || false)&&location.pathname!='/unsupported-browser'){location.href='/unsupported-browser';}}; brave_test();</script>";
|
|
"~Mozilla.*Firefox/[0-9]+" "";
|
|
}
|
|
|
|
server {
|
|
server_name localhost;
|
|
listen 8080 default;
|
|
root @PWD;
|
|
index index.html;
|
|
|
|
location / {
|
|
try_files $uri $uri.html $uri/ =404;
|
|
sub_filter "__X_MATHJAX_POLYFILL_PLACEHOLDER__" $mathjax_polyfill;
|
|
error_page 401 403 404 410 /40x.html;
|
|
error_page 500 502 503 504 /50x.html;
|
|
}
|
|
}
|
|
}
|