updated nginx conf for cms
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 42s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 42s
This commit is contained in:
20
nginx.conf
20
nginx.conf
@@ -1,10 +1,24 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
server_name localhost; # This is fine as Traefik handles the external domain
|
||||
root /usr/share/nginx/html;
|
||||
|
||||
# Specific location for the Decap CMS admin panel
|
||||
# This ensures that any request to /admin/ or /admin/* (that isn't an existing file/dir)
|
||||
# serves /admin/index.html, allowing Decap's client-side router to work.
|
||||
location /admin/ {
|
||||
try_files $uri $uri/ /admin/index.html;
|
||||
}
|
||||
|
||||
# General location block for the rest of your site
|
||||
location / {
|
||||
index index.html;
|
||||
try_files $uri $uri/ =404;
|
||||
index index.html; # Serves index.html from directories
|
||||
try_files $uri $uri/ =404; # Returns 404 if file/directory not found.
|
||||
# If your main site is also an SPA, change to: try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# Optional: Deny access to hidden files like .htaccess or .git
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user