forked from roots/bedrock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
80 lines (63 loc) · 2.05 KB
/
nginx.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
70
71
72
73
74
75
76
77
78
79
80
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;
proxy_buffer_size 256k;
fastcgi_buffers 16 256k;
fastcgi_buffer_size 256k;
index index.php index.html index.htm;
server_tokens off;
include /workspace/hidemywpghost.conf;
client_max_body_size 256M;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Strict-Transport-Security 'max-age=300; includeSubDomains; preload; always;';
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types image/svg+xml text/plain text/xml text/css text/javascript application/xml application/xhtml+xml application/rss+xml application/javascript application/x-font-ttf application/vnd.ms-fontobject font/opentype font/ttf font/eot font/otf;
set $no_cache 0;
if ($request_uri ~* "/wp-admin") { set $no_cache 1; }
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") { set $no_cache 1; }
#include letsencrypt.conf;
#include theexample-redirections.conf;
rewrite ^/wp-content(/.*)$ /app$1 last;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
return 200 "User-agent: *\nDisallow: /wp-admin";
}
location ^~ /xmlrpc.php {
deny all;
}
location ^~ /app/uploads/ {
expires max;
}
#location ^~ /status/ {
# stub_status on;
# allow 127.0.0.1;
# deny all;
#}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~* /app/uploads/.*.php$ {
deny all;
}
location ~ \.php$ {
include fastcgi_params;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/tmp/heroku.fcgi.8080.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found on;
}