-
Notifications
You must be signed in to change notification settings - Fork 7
/
nginx-wordpress-fastcgi.conf
69 lines (50 loc) · 1.43 KB
/
nginx-wordpress-fastcgi.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
57
58
59
60
61
62
63
64
65
66
67
68
69
http {
map $http_accept $webp_suffix {
"~*webp" ".webp";
}
map $msie $cache_control {
default "max-age=31536000, public, no-transform, immutable";
"1" "max-age=31536000, private, no-transform, immutable";
}
map $msie $vary_header {
default "Accept";
"1" "";
}
limit_req_zone $binary_remote_addr$host zone=ltwo:10m rate=3r/s;
fastcgi_cache_path /usr/local/nginx/cache2 levels=1:2 inactive=2h keys_zone=two:10m max_size=100m;
}
server {
listen 192.168.0.1:80;
server_name site.ru;
return 301 https://site.ru$request_uri;
}
server {
listen 192.168.0.1:443 ssl;
server_name site.ru;
ssl_certificate /etc/nginx/ssl/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
charset utf-8;
root /home/httpd/wodpress/www;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location /wp-content {
add_header Vary $vary_header;
add_header Cache-Control $cache_control;
try_files $uri$webp_suffix $uri =404;
}
location /xmlrpc.php {
deny all;
}
location ~ \.php$ {
limit_req zone=ltwo burst=10 nodelay;
#fastcgi_cache two;
#fastcgi_cache_key $scheme$proxy_host$request_uri$cookie_wptouch-device-orientation;
#fastcgi_ignore_headers Cache-Control Expires;
#fastcgi_cache_valid 12h;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
}
}