1
1
server {
2
2
listen 0.0.0.0:80;
3
3
4
+ #listen 80 server;
5
+ #listen [::]:80 server;
6
+ #listen 443 ssl http2;
7
+ #listen [::]:443 ssl http2;
8
+
9
+ #ssl_certificate /etc/letsencrypt/live/vvveb.com/fullchain.pem;
10
+ #ssl_certificate_key /etc/letsencrypt/live/vvveb.com/privkey.pem;
11
+ #ssl_session_cache shared:SSL:20m;
12
+ #ssl_session_timeout 10m;
13
+ #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
14
+ #ssl_prefer_server_ciphers on;
15
+ #ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';
16
+
4
17
error_log /var/log/nginx/error.log;
5
18
access_log /var/log/nginx/access.log;
6
19
@@ -9,6 +22,21 @@ server {
9
22
index index.php index.html;
10
23
error_page 404 /index.php;
11
24
25
+ gzip on;
26
+ gzip_vary on;
27
+ gzip_min_length 10240;
28
+ gzip_proxied any;
29
+ gzip_comp_level 6;
30
+ gzip_buffers 16 8k;
31
+ gzip_http_version 1.1;
32
+ gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
33
+
34
+ #charset utf-8;
35
+
36
+ add_header X-Frame-Options "SAMEORIGIN";
37
+ add_header X-XSS-Protection "1; mode=block";
38
+ add_header X-Content-Type-Options "nosniff";
39
+
12
40
set $skip_cache 0;
13
41
set $cache_uri $request_uri;
14
42
@@ -37,7 +65,23 @@ server {
37
65
}
38
66
39
67
#static files
40
- location ~* "\.(?!php)([\w]{3,4})$" {
68
+ #error_page 404 /index.php;
69
+ #error_page 404 /404.html;
70
+
71
+ location = /favicon.ico {
72
+ log_not_found off;
73
+ access_log off;
74
+ }
75
+
76
+ #add domain to sitemaps for multisite
77
+ location = /robots.txt {
78
+ log_not_found off;
79
+ access_log off;
80
+ try_files $uri /index.php$is_args$args;
81
+ }
82
+
83
+ #static files
84
+ location ~* "\.(?!php)([\w]{3,5})$" {
41
85
expires max;
42
86
log_not_found off;
43
87
sendfile on;
@@ -50,21 +94,31 @@ server {
50
94
location / {
51
95
default_type text/html;
52
96
index index.php index.html index.htm;
53
- try_files /page-cache/$http_host $cache_uri /page-cache/$http_host $cache_uri/index.html $uri $uri/ /index.php$is_args$args;
97
+ try_files /page-cache/$host $cache_uri /page-cache/$host $cache_uri/index.html $uri $uri/ /index.php$is_args$args;
54
98
#try_files $uri $uri/ /index.php$is_args$args;
55
99
56
100
#cache debug
57
101
#add_header "uri" $cache_uri;
102
+ #add_header "skip_cache" $skip_cache;
103
+
104
+ location ~ /media/.+?\.php$ {
105
+ deny all;
58
106
}
59
107
60
108
location ~ \.php$ {
61
109
# try_files $uri =404;
62
110
63
111
#fastcgi_pass unix:/var/run/php-fpm83/php-fpm.pid;
64
- fastcgi_pass php:9000;
112
+ #fastcgi_pass php:9000;
113
+ fastcgi_pass 127.0.0.1:9000;
65
114
fastcgi_index index.php;
66
115
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
67
116
fastcgi_param PATH_INFO $fastcgi_path_info;
68
117
include fastcgi_params;
118
+ }
119
+ }
120
+
121
+ location ~ /\.(?!well-known).* {
122
+ deny all;
69
123
}
70
124
}
0 commit comments