The new index on the `user_id` column in the `profiles` table improves query performance when filtering or joining by user identifier, reducing full table scans during profile retrieval operations.
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
upstream app {
|
|
server app:10500;
|
|
}
|
|
|
|
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=app_cache:10m max_size=${NGINX_CACHE_MAX_SIZE:-1g} inactive=60m use_temp_path=off;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
client_max_body_size 20M;
|
|
|
|
add_header X-Content-Type-Options nosniff;
|
|
add_header X-Frame-Options DENY;
|
|
add_header X-XSS-Protection "1; mode=block";
|
|
add_header Referrer-Policy strict-origin-when-cross-origin;
|
|
|
|
gzip on;
|
|
gzip_types text/plain text/css text/javascript application/javascript application/json image/svg+xml;
|
|
gzip_min_length 1000;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
|
|
location /static/ {
|
|
alias /app/static/;
|
|
expires 7d;
|
|
add_header Cache-Control "public, immutable, max-age=604800";
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
|
|
location /avatar/ {
|
|
proxy_pass http://app;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://app;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_read_timeout 60s;
|
|
proxy_send_timeout 60s;
|
|
|
|
${NGINX_CACHE_CONFIG}
|
|
}
|
|
}
|