73 lines
1.7 KiB
Nginx Configuration File
73 lines
1.7 KiB
Nginx Configuration File
# ©AngelaMos | 2026
|
|
# nginx.conf
|
|
|
|
worker_processes auto;
|
|
worker_rlimit_nofile 4096;
|
|
|
|
events {
|
|
worker_connections 2048;
|
|
multi_accept on;
|
|
use epoll;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
default upgrade;
|
|
'' close;
|
|
}
|
|
|
|
log_format main_timed '$remote_addr - $remote_user [$time_iso8601] '
|
|
'"$request" $status $body_bytes_sent '
|
|
'"$http_referer" "$http_user_agent" '
|
|
'rt=$request_time uct="$upstream_connect_time" '
|
|
'uht="$upstream_header_time" urt="$upstream_response_time"';
|
|
|
|
access_log /var/log/nginx/access.log main_timed;
|
|
error_log /var/log/nginx/error.log info;
|
|
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
keepalive_timeout 65;
|
|
types_hash_max_size 2048;
|
|
server_tokens off;
|
|
|
|
client_max_body_size 2m;
|
|
client_body_buffer_size 16k;
|
|
client_header_buffer_size 4k;
|
|
large_client_header_buffers 4 16k;
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_min_length 256;
|
|
gzip_types
|
|
application/javascript
|
|
application/json
|
|
application/manifest+json
|
|
application/xml
|
|
font/woff2
|
|
text/css
|
|
text/plain
|
|
text/xml;
|
|
|
|
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=20r/s;
|
|
limit_conn_zone $binary_remote_addr zone=conn_limit:10m;
|
|
|
|
upstream backend {
|
|
server backend:8080;
|
|
keepalive 32;
|
|
}
|
|
|
|
upstream frontend_dev {
|
|
server frontend:5173;
|
|
keepalive 16;
|
|
}
|
|
|
|
include /etc/nginx/conf.d/*.conf;
|
|
}
|