diff options
| author | IwanIDev <iwan@iwani.dev> | 2026-03-21 17:53:39 +0000 |
|---|---|---|
| committer | IwanIDev <iwan@iwani.dev> | 2026-03-21 17:53:39 +0000 |
| commit | fb7fa2f1b8321d5505c0e3afda59cb9c904f106b (patch) | |
| tree | 13c63273ef0bf0f1c4a7c4b4dee725a627127643 | |
| parent | 76da48766c562c43a65db4e25030ea3acb16d34c (diff) | |
fix: update nginx configuration to prevent 301 redirects for directory index files
| -rw-r--r-- | nginx/default.conf | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nginx/default.conf b/nginx/default.conf index 97d7f4c..079b303 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -5,8 +5,11 @@ server { root /usr/share/nginx/html; index index.html; + absolute_redirect off; + port_in_redirect off; location / { - try_files $uri $uri/ /index.html; + # Serve directory index files without triggering a 301 slash redirect. + try_files $uri $uri/index.html /index.html; } } |
