|
@@ -0,0 +1,73 @@
|
|
1
|
+user nginx;
|
|
2
|
+worker_processes 1;
|
|
3
|
+
|
|
4
|
+error_log /var/log/nginx/error.log warn;
|
|
5
|
+pid /var/run/nginx.pid;
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+events {
|
|
9
|
+ worker_connections 1024;
|
|
10
|
+}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+http {
|
|
14
|
+ include /etc/nginx/mime.types;
|
|
15
|
+ default_type application/octet-stream;
|
|
16
|
+
|
|
17
|
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
18
|
+ '$status $body_bytes_sent "$http_referer" '
|
|
19
|
+ '"$http_user_agent" "$http_x_forwarded_for"';
|
|
20
|
+
|
|
21
|
+ access_log /var/log/nginx/access.log main;
|
|
22
|
+
|
|
23
|
+ sendfile on;
|
|
24
|
+
|
|
25
|
+ keepalive_timeout 65;
|
|
26
|
+
|
|
27
|
+ server_tokens off;
|
|
28
|
+
|
|
29
|
+ add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
|
|
30
|
+ add_header Content-Security-Policy "default-src 'none'; script-src 'self'; img-src 'self'; style-src 'self'; font-src 'self'; frame-ancestors 'none'; form-action 'none'; base-uri 'none';";
|
|
31
|
+ add_header X-Frame-Options "SAMEORIGIN";
|
|
32
|
+ add_header X-Content-Type-Options "nosniff";
|
|
33
|
+ add_header X-XSS-Protection "1; mode=block";
|
|
34
|
+ add_header Expect-CT "enforce; max-age=3600";
|
|
35
|
+ add_header Referrer-Policy "no-referrer";
|
|
36
|
+
|
|
37
|
+ gzip on;
|
|
38
|
+ gzip_vary on;
|
|
39
|
+ gzip_proxied any;
|
|
40
|
+ gzip_comp_level 6;
|
|
41
|
+ gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
42
|
+
|
|
43
|
+ map $http_accept $webp_suffix {
|
|
44
|
+ "~*webp" ".webp";
|
|
45
|
+ }
|
|
46
|
+
|
|
47
|
+ server {
|
|
48
|
+ listen 80;
|
|
49
|
+ server_name localhost;
|
|
50
|
+
|
|
51
|
+ location / {
|
|
52
|
+ root /usr/share/nginx/html;
|
|
53
|
+ index index.html index.htm;
|
|
54
|
+
|
|
55
|
+ location /res {
|
|
56
|
+ expires 1y;
|
|
57
|
+ }
|
|
58
|
+
|
|
59
|
+ location ~ \.(png|jpe?g)$ {
|
|
60
|
+ try_files $uri$webp_suffix $uri =404;
|
|
61
|
+ expires 1y;
|
|
62
|
+ }
|
|
63
|
+ }
|
|
64
|
+
|
|
65
|
+ #error_page 404 /404.html;
|
|
66
|
+
|
|
67
|
+ error_page 500 502 503 504 /50x.html;
|
|
68
|
+ location = /50x.html {
|
|
69
|
+ root /usr/share/nginx/html;
|
|
70
|
+ }
|
|
71
|
+ }
|
|
72
|
+
|
|
73
|
+}
|