Files
Website/nginx.conf
2025-06-01 14:01:53 +02:00

38 lines
1.1 KiB
Nginx Configuration File

server {
listen 8097;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm index.php;
# Handle src directory (for your TypeScript/React files)
location /src/ {
try_files $uri =404;
# Add MIME type for .tsx files if needed
location ~* \.(tsx|ts)$ {
add_header Content-Type application/javascript;
}
}
# Handle public directory assets
location /public/ {
try_files $uri =404;
}
# Handle root-level requests for public assets (like /felo-icon.svg)
location ~ \.(ico|svg|png|jpg|jpeg|gif|css|js|woff|woff2|ttf|eot)$ {
# Try the file directly, then in public folder
try_files $uri /public$uri =404;
expires 1y;
add_header Cache-Control "public, immutable";
}
# Default location for everything else
location / {
try_files $uri $uri/ =404;
}
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
}