Monorepo for Aesthetic.Computer
aesthetic.computer
1worker_processes auto;
2worker_rlimit_nofile 100000;
3
4events {
5 worker_connections 2048; # Increased to handle more connections
6 use epoll; # Use epoll for Linux systems for better performance
7}
8
9http {
10 include /etc/nginx/mime.types;
11 default_type application/octet-stream;
12 charset utf-8; # Ensure UTF-8 encoding is used by default
13
14 sendfile on;
15 tcp_nopush on;
16 tcp_nodelay on;
17 keepalive_timeout 65; # Adjusted keepalive timeout for better resource management
18 types_hash_max_size 2048; # Increase the hash bucket size for better performance
19
20 gzip on;
21 gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
22 gzip_proxied any;
23 gzip_comp_level 6;
24 gzip_vary on;
25 gzip_min_length 256;
26 gzip_buffers 16 8k;
27 gzip_http_version 1.1;
28
29 proxy_cache_path /tmp/cache levels=1:2 keys_zone=static_cache:100m inactive=24h max_size=1g;
30 proxy_cache_key "$scheme$request_method$host$request_uri";
31
32 client_body_buffer_size 128k;
33 client_max_body_size 10m;
34 client_header_buffer_size 1k;
35 large_client_header_buffers 4 16k;
36
37 server {
38 listen 8111;
39 server_name localhost;
40
41 root /home/me/aesthetic-computer/system/public;
42 index index.html index.htm;
43
44 location / {
45 try_files $uri $uri/ =404;
46 etag on;
47 if_modified_since exact;
48
49 #proxy_cache static_cache;
50 #proxy_cache_valid 200 1d;
51 #add_header X-Proxy-Cache $upstream_cache_status;
52
53 # Cache bypass and revalidation
54 # proxy_cache_bypass $http_cache_control;
55 # proxy_no_cache $http_cache_control;
56 #proxy_cache_revalidate on;
57
58 # Ensure cache invalidation on file changes
59 #open_file_cache max=1000 inactive=20s;
60 #open_file_cache_valid 30s;
61 #open_file_cache_min_uses 2;
62 #open_file_cache_errors on;
63 }
64
65 access_log off;
66 error_log /var/log/nginx/error.log warn; # Logging errors for better troubleshooting
67 }
68}