Files
schemas-app/nginx/nginx.conf
T

66 lines
1.7 KiB
Nginx Configuration File
Raw Normal View History

user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
types {
application/manifest+json webmanifest;
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
access_log off;
# Security headers
include /etc/nginx/security_headers.conf;
# Health check endpoint for Kubernetes
location = /health {
return 200 '{"status":"UP"}';
}
# all assets contain hash in filename, cache forever
location ^~ /assets/ {
include /etc/nginx/security_headers.conf;
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
try_files $uri =404;
}
# Nuxt generated files
location /_nuxt/ {
access_log /var/log/nginx/access.log main;
include /etc/nginx/security_headers.conf;
autoindex off;
expires off;
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
}
# Main application - SPA mode
location / {
access_log /var/log/nginx/access.log main;
include /etc/nginx/security_headers.conf;
autoindex off;
expires off;
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
try_files $uri $uri/ /index.html =404;
}
}
}