Some checks failed
Build and Deploy Backend / Run Linters and Tests (Backend) (push) Successful in 19s
Build and Deploy Backend / Build (Backend) (push) Has been cancelled
Build and Deploy Backend / Build Native Android App (EAS) (push) Has been cancelled
Build and Deploy Backend / Deploy to Host (push) Has been cancelled
Build and Deploy Backend / Build (Frontend Web) (push) Has been cancelled
37 lines
1.1 KiB
Nginx Configuration File
37 lines
1.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name app.maia.depaoli.id.au;
|
|
|
|
# Set the root directory for static files
|
|
root /usr/share/nginx/html;
|
|
# Default file to serve
|
|
index index.html index.htm;
|
|
|
|
location / {
|
|
# Crucial for SPAs:
|
|
# - Try to serve the requested file ($uri)
|
|
# - If it's not found, try it as a directory ($uri/)
|
|
# - If that's not found, serve index.html (letting client-side routing handle it)
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
# Add gzip compression for better performance
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss text/javascript image/svg+xml;
|
|
|
|
# Improve caching for assets
|
|
location ~* \.(?:css|js|jpg|jpeg|gif|png|ico|svg|woff|woff2|ttf|eot)$ {
|
|
expires 1y;
|
|
add_header Cache-Control "public";
|
|
access_log off; # Don't log access for static assets
|
|
}
|
|
|
|
# Deny access to hidden files
|
|
location ~ /\. {
|
|
deny all;
|
|
}
|
|
}
|