capybara/support/nginx-dev.conf

38 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2021-06-11 10:09:29 +00:00
# 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>";
2021-06-11 10:09:29 +00:00
"~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;
2021-07-07 05:47:37 +00:00
error_page 401 403 404 410 /40x.html;
error_page 500 502 503 504 /50x.html;
2021-06-11 10:09:29 +00:00
}
}
}