-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf.example
More file actions
85 lines (72 loc) · 2.41 KB
/
nginx.conf.example
File metadata and controls
85 lines (72 loc) · 2.41 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# FireAI Landing Page - Nginx Configuration Example
# File này dùng cho VPS với Nginx
# Copy nội dung này vào /etc/nginx/sites-available/default hoặc tạo file mới
server {
listen 80;
listen [::]:80;
server_name yourdomain.com www.yourdomain.com;
# Redirect HTTP to HTTPS (bỏ comment sau khi cài SSL)
# return 301 https://$server_name$request_uri;
# Root directory
root /var/www/html;
index index.html;
# Logs
access_log /var/log/nginx/fireai-access.log;
error_log /var/log/nginx/fireai-error.log;
# Main location
location / {
try_files $uri $uri/ /index.html;
}
# Cache static files
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
}
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/json application/xml image/svg+xml;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Deny access to hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Deny access to config files (nếu không muốn public)
# location ~ \.(json|md|log)$ {
# deny all;
# }
}
# HTTPS Configuration (sau khi cài SSL với Certbot)
# Certbot sẽ tự động tạo file này, nhưng bạn có thể tham khảo:
# server {
# listen 443 ssl http2;
# listen [::]:443 ssl http2;
# server_name yourdomain.com www.yourdomain.com;
#
# root /var/www/html;
# index index.html;
#
# # SSL certificates (Certbot sẽ tự động điền)
# ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
#
# # SSL configuration
# ssl_protocols TLSv1.2 TLSv1.3;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
#
# # Same location blocks as above
# location / {
# try_files $uri $uri/ /index.html;
# }
#
# # ... rest of configuration
# }