This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx.conf
56 lines (43 loc) · 1.56 KB
/
nginx.conf
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
# Determine the number of worker processes automatically
worker_processes auto;
# Events module configuration
events {
# Maximum number of simultaneous connections that can be opened by a worker process
worker_connections 1024;
}
http{
# Enable high-performance file transfer
sendfile on;
# Route to log files. Log level is set to warn
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
server {
listen 3001;
server_name ${DOMAIN}; #Your domain
# Turn on gzip compression.
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss image/svg+xml;
location / {
# Enable Gzip static file serving.
gzip_static on;
# Enable runtime decompression before sending downstream.
gunzip on;
# Root directory
root /usr/share/nginx/html/;
index index.html;
# MIME types and caching
include /etc/nginx/mime.types;
expires 30d;
# add_header Cache-Control "public, no-transform";
add_header X-Frame-Options "SAMEORIGIN" always; # defence agains Clickjacking attacks
add_header X-XSS-Protection "1; mode=block" always; # defence agains Cross-Site Scripting (XSS) attacks
add_header X-Content-Type-Options "nosniff" always; # defence agains MIME type sniffing attacks
try_files $uri $uri/ /index.html;
# Hide the Nginx version number in the HTTP headers
server_tokens off;
}
}
}