31 lines
788 B
Nginx Configuration File
31 lines
788 B
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name mieterportal.hocks.eu localhost _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
gzip on;
|
|
gzip_types text/css application/javascript image/svg+xml application/json;
|
|
gzip_min_length 1024;
|
|
|
|
# HTML nie cachen (Assets sind hash-benannt → ein Reload genügt)
|
|
location = /index.html {
|
|
add_header Cache-Control "no-cache" always;
|
|
}
|
|
|
|
# Cache für gehashte Build-Assets
|
|
location /assets/ {
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# SPA-Fallback für React Router
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-Frame-Options "DENY" always;
|
|
}
|