1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2024-09-21 11:56:02 +00:00
buildpack-nginx/conf/app-nginx.conf.sigil
Zach Ahn 6672b6257a
Respond with a 404 when the file doesn't exist
Prior to this, I was seeing the successful HTTP status 200 when
requesting files that did not exist.

With this change, the server sends back Nginx's default 404 page instead
of the home page.
2021-12-02 22:19:05 -05:00

30 lines
467 B
Plaintext

worker_processes 1;
error_log stderr;
pid nginx.pid;
daemon off;
events {
worker_connections 768;
}
http {
types_hash_max_size 2048;
include mime.types;
charset UTF-8;
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/ =404;
}
}
}