-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnginx.conf
More file actions
35 lines (27 loc) · 816 Bytes
/
nginx.conf
File metadata and controls
35 lines (27 loc) · 816 Bytes
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
# /etc/nginx/nginx.conf
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# Define the server block
server {
listen 80;
server_name localhost;
# Root directory where the static files are served
root /usr/share/nginx/html;
# Index file for the root
index index.html;
# Handle requests for static assets
location / {
try_files $uri /index.html; # This serves index.html for any route
}
# Optional: Gzip compression for better performance
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_min_length 1000;
}
}