Files
mtusi2026lab7/infra/nginx.conf
2026-11-24 12:20:21 +03:00

47 lines
1.4 KiB
Nginx Configuration File

pid /run/nginx.pid;
events {}
http {
access_log /dev/stdout;
error_log /dev/stderr notice;
resolver 127.0.0.11 valid=2s ipv6=off;
upstream messenger_api {
zone messenger_api 64k;
include /run/nginx-upstream.conf;
keepalive 16;
}
server {
listen 8443 ssl;
ssl_certificate /run/tls/cert.crt;
ssl_certificate_key /run/tls/key.key;
ssl_protocols TLSv1.2 TLSv1.3;
add_header Strict-Transport-Security "max-age=86400" always;
client_max_body_size 0;
client_body_timeout 20s;
location / {
proxy_request_buffering off;
proxy_buffering off;
proxy_pass https://messenger_api;
proxy_ssl_verify on;
proxy_ssl_trusted_certificate /run/ca/ca.crt;
proxy_ssl_server_name on;
proxy_ssl_name messenger-api;
proxy_ssl_certificate /run/tls/cert.crt;
proxy_ssl_certificate_key /run/tls/key.key;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 500ms;
proxy_send_timeout 65s;
proxy_read_timeout 65s;
proxy_next_upstream error timeout http_502 http_503 http_504;
proxy_next_upstream_tries 2;
}
}
}