iac/apps/django/base/nginx-configmap.yaml
2026-05-12 14:39:00 +05:00

72 lines
1.7 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-configmap
namespace: django
data:
nginx.conf: |
user nginx;
worker_processes auto;
error_log stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /dev/stdout main;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
client_header_buffer_size 16k;
large_client_header_buffers 4 16k;
listen 80;
server_name localhost;
root /opt/react_client;
expires off;
location = /static/index.bundle.js {
add_header Cache-Control 'no-store no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
}
location / {
try_files $uri @index;
}
location @index {
add_header Cache-Control 'no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
try_files /static/index.html =404;
}
location /service-worker.js {
try_files /static/$uri @index;
}
location = /ping {
return 200 '{"result": "ok"}';
}
}
}