-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx.conf
More file actions
31 lines (26 loc) · 923 Bytes
/
nginx.conf
File metadata and controls
31 lines (26 loc) · 923 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
server {
listen 8080;
server_name _;
# Disable server tokens to hide Nginx version information
server_tokens off;
absolute_redirect off;
port_in_redirect off;
# Add security headers
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Permissions-Policy "geolocation=(self), microphone=()" always;
# Disable directory listing globally
autoindex off;
location / {
root /usr/share/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
location /assets/ {
alias /usr/share/nginx/html/assets/;
try_files $uri $uri/ =404;
}
}