質問編集履歴
1
http.confファイルを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -33,3 +33,287 @@
|
|
33
33
|
|
34
34
|
|
35
35
|
KUSANAGI、NGINXの設定を何回も見ているのですが、どうしても解決できずにいます。詳しい方がいらっしゃいましたらご教授いただけないでしょうか?よろしくお願いいたします。
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
```ここに言語を入力
|
44
|
+
|
45
|
+
#=======================================
|
46
|
+
|
47
|
+
# サイトB
|
48
|
+
|
49
|
+
#---------------------------------------
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
server {
|
54
|
+
|
55
|
+
listen 80;
|
56
|
+
|
57
|
+
server_name サイトB www.サイトB;
|
58
|
+
|
59
|
+
access_log /home/kusanagi/サイトB/log/nginx/access.log main;
|
60
|
+
|
61
|
+
error_log /home/kusanagi/サイトB/log/nginx/error.log warn;
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
rewrite ^(.*)$ https://サイトB$request_uri permanent; # SSL ONLY
|
66
|
+
|
67
|
+
rewrite ^(.*)$ https://www.サイトB$request_uri permanent; # SSL ONLY
|
68
|
+
|
69
|
+
charset UTF-8;
|
70
|
+
|
71
|
+
client_max_body_size 16M;
|
72
|
+
|
73
|
+
root /home/kusanagi/サイトB/DocumentRoot;
|
74
|
+
|
75
|
+
index index.php index.html index.htm;
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
location = /50x.html {
|
80
|
+
|
81
|
+
return 403;
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
location / {
|
94
|
+
|
95
|
+
try_files $uri $uri/ /index.php?$args;
|
96
|
+
|
97
|
+
#include naxsi.d/wordpress/*.conf;
|
98
|
+
|
99
|
+
}
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
location = /favicon.ico {
|
104
|
+
|
105
|
+
log_not_found off;
|
106
|
+
|
107
|
+
access_log off;
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
location ~* /.well-known {
|
114
|
+
|
115
|
+
allow all;
|
116
|
+
|
117
|
+
}
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
location ~* /. {
|
122
|
+
|
123
|
+
deny all;
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
#include templates.d/multisite.conf;
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
location ~* /(?:uploads|files)/.*.php$ {
|
134
|
+
|
135
|
+
deny all;
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
location ~* .(jpg|jpeg|gif|png|css|js|swf|ico|pdf|svg|eot|ttf|woff)$ {
|
142
|
+
|
143
|
+
expires 60d;
|
144
|
+
|
145
|
+
access_log off;
|
146
|
+
|
147
|
+
}
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
location ~* /wp-login.php|/wp-admin/((?!(admin-ajax.php|images/)).)*$ {
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
satisfy any;
|
156
|
+
|
157
|
+
allow 0.0.0.0/0;
|
158
|
+
|
159
|
+
allow 127.0.0.1;
|
160
|
+
|
161
|
+
deny all;
|
162
|
+
|
163
|
+
auth_basic "basic authentication";
|
164
|
+
|
165
|
+
auth_basic_user_file "/home/kusanagi/.htpasswd";
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
location ~ [^/].php(/|$) {
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
fastcgi_split_path_info ^(.+?.php)(/.*)$;
|
174
|
+
|
175
|
+
if (!-f $document_root$fastcgi_script_name) {
|
176
|
+
|
177
|
+
return 404;
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
fastcgi_pass 127.0.0.1:9000;
|
182
|
+
|
183
|
+
fastcgi_index index.php;
|
184
|
+
|
185
|
+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
186
|
+
|
187
|
+
include fastcgi_params;
|
188
|
+
|
189
|
+
fastcgi_buffers 256 128k;
|
190
|
+
|
191
|
+
fastcgi_buffer_size 128k;
|
192
|
+
|
193
|
+
fastcgi_intercept_errors on;
|
194
|
+
|
195
|
+
fastcgi_read_timeout 120s;
|
196
|
+
|
197
|
+
#include naxsi.d/wordpress/*.conf;
|
198
|
+
|
199
|
+
}
|
200
|
+
|
201
|
+
include conf.d/security.conf;
|
202
|
+
|
203
|
+
#include naxsi.d/wordpress/*.conf;
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
location ~ [^/].php(/|$) {
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
fastcgi_split_path_info ^(.+?.php)(/.*)$;
|
214
|
+
|
215
|
+
if (!-f $document_root$fastcgi_script_name) {
|
216
|
+
|
217
|
+
return 404;
|
218
|
+
|
219
|
+
}
|
220
|
+
|
221
|
+
fastcgi_pass 127.0.0.1:9000;
|
222
|
+
|
223
|
+
fastcgi_index index.php;
|
224
|
+
|
225
|
+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
226
|
+
|
227
|
+
include fastcgi_params;
|
228
|
+
|
229
|
+
fastcgi_buffers 256 128k;
|
230
|
+
|
231
|
+
fastcgi_buffer_size 128k;
|
232
|
+
|
233
|
+
fastcgi_intercept_errors on;
|
234
|
+
|
235
|
+
fastcgi_read_timeout 120s;
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
set $do_not_cache 1; ## page cache
|
240
|
+
|
241
|
+
set $device "pc";
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
if ($request_method = POST) {
|
246
|
+
|
247
|
+
set $do_not_cache 1;
|
248
|
+
|
249
|
+
}
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
if ($query_string != "") {
|
254
|
+
|
255
|
+
set $do_not_cache 1;
|
256
|
+
|
257
|
+
}
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
|
262
|
+
|
263
|
+
set $do_not_cache 1;
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-c$ set $do_not_cache 1;
|
270
|
+
|
271
|
+
}
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
if ($http_user_agent ~* " Android |(iPad|Android; Tablet; .+Firefox") {
|
276
|
+
|
277
|
+
set $device "tablet";
|
278
|
+
|
279
|
+
}
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
if ($http_user_agent ~* "Android .+ Mobile|(iPhone|(iPod|IEMobile|Android; Mobile; .+Firefox|Windows Phone") {
|
284
|
+
|
285
|
+
set $device "smart";
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
fastcgi_cache wpcache;
|
292
|
+
|
293
|
+
fastcgi_cache_key "$device:$request_method:$scheme://$host$request_uri";
|
294
|
+
|
295
|
+
fastcgi_cache_valid 200 10m;
|
296
|
+
|
297
|
+
fastcgi_no_cache $do_not_cache;
|
298
|
+
|
299
|
+
fastcgi_cache_bypass $do_not_cache;
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
add_header X-F-Cache $upstream_cache_status;
|
304
|
+
|
305
|
+
add_header X-Signature KUSANAGI;
|
306
|
+
|
307
|
+
include conf.d/security.conf;
|
308
|
+
|
309
|
+
#include naxsi.d/wordpress/*.conf;
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
}
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
```
|