-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
35 lines (29 loc) · 1.53 KB
/
nginx.conf
File metadata and controls
35 lines (29 loc) · 1.53 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
35
# Set the default MIME type for unrecognized files to binary.
#default_type application/octet-stream;
# Enable gzip compression to reduce transferred data size and improve performance.
gzip on;
gzip_comp_level 6; # Set compression level.
gzip_vary on; # Add "Vary: Accept-Encoding" header.
gzip_min_length 1000; # Minimum length for compression.
gzip_proxied any; # Enable compression for proxied requests.
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Specify types of content to compress.
gzip_buffers 16 8k; # Set gzip buffer size.
# Set the maximum allowed size for the client request body.
client_max_body_size 256M;
# Set the root directory from which Nginx will serve files.
root /usr/share/nginx/html;
# Define the server block to handle incoming requests.
server {
# Listen for incoming connections on all available IPv4 and IPv6 addresses on port 80.
listen 0.0.0.0:80;
listen [::]:80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Define how Nginx should handle requests for the root path ("/").
location / {
root /usr/share/nginx/html/browser;
try_files $uri $uri/ /index.html =404; # Try to serve requested URI, directory index, or fallback to index.html. Return 404 if none succeed.
}
}