Fix nginx root location handling for index.html
- Updated try_files directive to serve index.html for root requests - Changed from 'try_files / =404;' to 'try_files / /index.html =404;' - This fixes 403 error when requesting bare domain URL - Ensures proper fallback to index.html for root directory requests
This commit is contained in:
@@ -47,7 +47,7 @@ http {
|
|||||||
|
|
||||||
# Static files for root directory
|
# Static files for root directory
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ =404;
|
try_files $uri $uri/ /index.html =404;
|
||||||
|
|
||||||
# Expires headers for static assets
|
# Expires headers for static assets
|
||||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|bmp|webp|cur)$ {
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|bmp|webp|cur)$ {
|
||||||
|
|||||||
Reference in New Issue
Block a user