forked from StellarFlow-Network/stellarflow-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
34 lines (30 loc) · 1.46 KB
/
Copy pathnginx.conf
File metadata and controls
34 lines (30 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
http {
# Enable Brotli compression
brotli on;
brotli_comp_level 6; # Compression level (1-11, 6 is a good balance)
brotli_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype;
# Enable Gzip compression (as a fallback if Brotli is not supported)
gzip on;
gzip_comp_level 6;
gzip_min_length 1000;
gzip_proxied any;
gzip_vary on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype;
server {
listen 80;
server_name your_domain.com; # Replace with your domain
location / {
# Proxy requests to the Next.js application running on port 3000
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# Ensure Nginx passes the Accept-Encoding header to Next.js
# and handles the Content-Encoding response.
# Nginx will serve its own compressed version if configured.
proxy_set_header Accept-Encoding $http_accept_encoding;
}
}
}