-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwpstatic.conf
35 lines (35 loc) · 1.13 KB
/
wpstatic.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
# WordPressStatic-Proxy
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Real-IP;
location = /
{
rewrite ^(/.*)$ "https://admincdn.com/" redirect;
}
location = /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
location ~ ^/.*/.*$
{
proxy_pass http://core.svn.wordpress.org/tags/$wp_request_uri;
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header ETag;
proxy_hide_header Vary;
proxy_hide_header Content-Disposition;
proxy_set_header Host core.svn.wordpress.org;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Accept-Encoding "";
proxy_ssl_session_reuse off;
proxy_ssl_server_name on;
resolver 8.8.8.8 ipv6=off;
add_header Access-Control-Allow-Origin *;
# Set Nginx Cache
proxy_ignore_headers Set-Cookie Cache-Control expires;
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 301 302 30d;
expires 30d;
add_header AdminCDN-Cache $upstream_cache_status;
}