Files
apoena/nginx.conf
Julien Calixte 50d8eb31d6 fix(nginx): redirect unknown paths to homepage
Drop the $uri/ directory step in try_files which triggered the default
403 page on directories without an index, and 302 any 403/404 back to /.
2026-05-23 16:52:12 +02:00

24 lines
540 B
Nginx Configuration File

server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri.html $uri/index.html $uri/index.htm =404;
}
location /.well-known/ {
root /usr/share/nginx/html;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, OPTIONS";
}
error_page 403 404 =302 /;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
internal;
}
}