From fa61a2342c515bbf6f7d2385655837a1d63918ad Mon Sep 17 00:00:00 2001 From: ray Date: Sun, 3 May 2020 15:42:33 +0100 Subject: [PATCH] add custom nginx configuration add custom nginx config so we can set custom 404 page --- app-nginx.conf.sigil | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 app-nginx.conf.sigil diff --git a/app-nginx.conf.sigil b/app-nginx.conf.sigil new file mode 100644 index 0000000..ef868b2 --- /dev/null +++ b/app-nginx.conf.sigil @@ -0,0 +1,34 @@ +worker_processes 1; +error_log stderr; +pid nginx.pid; +daemon off; + +events { + worker_connections 768; +} + +http { + types_hash_max_size 2048; + include mime.types; + server { + listen {{ $.PORT }}; + server_name _; + {{ if ne $.NGINX_ROOT "" }} + root /app/www/{{ $.NGINX_ROOT }}; + {{ else }} + root /app/www; + {{ end }} + index index.html; + port_in_redirect off; + + location / { + try_files $uri $uri/ /index.html; + } + + error_page 404 /404.html; + location = /404.html { + root /app/www/{{ $.NGINX_ROOT }}; + internal; + } + } +}