質問編集履歴
3
informations
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
http://xxx.net/topics/api/** →cakephpを使用
|
10
10
|
|
11
|
-
http://xxx.net/infomations/ →Cakephpを使用
|
11
|
+
http://xxx.net/informations/ →Cakephpを使用
|
12
12
|
|
13
13
|
|
14
14
|
|
@@ -50,7 +50,7 @@
|
|
50
50
|
|
51
51
|
http://yyy.net/topics/api/** →cakephpを使用
|
52
52
|
|
53
|
-
http://yyy.net/infomations/ →Cakephpを使用
|
53
|
+
http://yyy.net/informations/ →Cakephpを使用
|
54
54
|
|
55
55
|
という形にしたいため、wordpressが動いているxxx.netでNginxの設定をいじって
|
56
56
|
|
@@ -62,7 +62,7 @@
|
|
62
62
|
|
63
63
|
http://xxx.net/topics/api/** →cakephpを使用
|
64
64
|
|
65
|
-
http://xxx.net/infomations/ →Cakephpを使用
|
65
|
+
http://xxx.net/informations/ →Cakephpを使用
|
66
66
|
|
67
67
|
という構成で検証をして、問題なければyyy.netで同じような設定を導入しようと思っています。
|
68
68
|
|
@@ -134,7 +134,7 @@
|
|
134
134
|
|
135
135
|
|
136
136
|
|
137
|
-
location /infomations {
|
137
|
+
location /informations {
|
138
138
|
|
139
139
|
root /var/www/html/xxx/app/webroot;
|
140
140
|
|
@@ -150,7 +150,7 @@
|
|
150
150
|
|
151
151
|
fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_script_name;
|
152
152
|
|
153
|
-
try_files /infomations/$1 /infomations/$1/ /subdir/index.php?to
|
153
|
+
try_files /informations/$1 /informations/$1/ /subdir/index.php?informations&$1&$args;
|
154
154
|
|
155
155
|
|
156
156
|
|
2
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,14 +32,16 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
-
|
35
|
+
〜なぜこの処置をするのか〜
|
36
|
-
|
37
|
-
|
36
|
+
|
37
|
+
|
38
38
|
|
39
39
|
現状、yyy.netとxxx.netで運営していてyyy.netではcakephp、
|
40
40
|
|
41
41
|
xxx.netではwordpressを使っています。
|
42
42
|
|
43
|
+
|
44
|
+
|
43
45
|
最終的に
|
44
46
|
|
45
47
|
http://yyy.net/ →Wordpressを使用
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,6 +20,60 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
+
現状の状況は以下の通りです。
|
24
|
+
|
25
|
+
WordPressは現状xxx.netで動いています。
|
26
|
+
|
27
|
+
CakePHPは現状yyy.net(別ドメイン)で動いています。(/var/www/html/xxx/app/webroot がルートディレクトリ)。
|
28
|
+
|
29
|
+
yyy.net/topics/api/** は現状でも見ることができるのですが、
|
30
|
+
|
31
|
+
xxx.net/topics/api/** でもアクセスできるようにしたいと考えています。
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
**なぜこの処置をするのか
|
36
|
+
|
37
|
+
**
|
38
|
+
|
39
|
+
現状、yyy.netとxxx.netで運営していてyyy.netではcakephp、
|
40
|
+
|
41
|
+
xxx.netではwordpressを使っています。
|
42
|
+
|
43
|
+
最終的に
|
44
|
+
|
45
|
+
http://yyy.net/ →Wordpressを使用
|
46
|
+
|
47
|
+
http://yyy.net/topics/ →Wordpressを使用
|
48
|
+
|
49
|
+
http://yyy.net/topics/api/** →cakephpを使用
|
50
|
+
|
51
|
+
http://yyy.net/infomations/ →Cakephpを使用
|
52
|
+
|
53
|
+
という形にしたいため、wordpressが動いているxxx.netでNginxの設定をいじって
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
http://xxx.net/ →Wordpressを使用
|
58
|
+
|
59
|
+
http://xxx.net/topics/ →Wordpressを使用
|
60
|
+
|
61
|
+
http://xxx.net/topics/api/** →cakephpを使用
|
62
|
+
|
63
|
+
http://xxx.net/infomations/ →Cakephpを使用
|
64
|
+
|
65
|
+
という構成で検証をして、問題なければyyy.netで同じような設定を導入しようと思っています。
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
23
77
|
以下の設定でうまくいかないのですが、どのように設定すれば良いのでしょうか...
|
24
78
|
|
25
79
|
|
@@ -48,7 +102,37 @@
|
|
48
102
|
|
49
103
|
|
50
104
|
|
51
|
-
location /topics/a
|
105
|
+
location /topics/article{
|
106
|
+
|
107
|
+
root /var/www/html/xxx/app/webroot;
|
108
|
+
|
109
|
+
index index.php index.html;
|
110
|
+
|
111
|
+
# try_files /topics/$1 /sample/$1/ /topics/index.php?$1&$args;
|
112
|
+
|
113
|
+
#try_files $uri $uri?$args $uri/ /index.php?$uri&$args /index.php?$args;
|
114
|
+
|
115
|
+
fastcgi_pass 127.0.0.1:9000;
|
116
|
+
|
117
|
+
fastcgi_index index.php;
|
118
|
+
|
119
|
+
fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_scr ipt_name;
|
120
|
+
|
121
|
+
try_files /topics/$1 /topics/$1/ /subdir/index.php?topics&$1&$args;
|
122
|
+
|
123
|
+
fastcgi_param PATH_INFO $fastcgi_path_info;
|
124
|
+
|
125
|
+
include fastcgi_params;
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
location /infomations {
|
52
136
|
|
53
137
|
root /var/www/html/xxx/app/webroot;
|
54
138
|
|
@@ -64,7 +148,7 @@
|
|
64
148
|
|
65
149
|
fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_script_name;
|
66
150
|
|
67
|
-
try_files /to
|
151
|
+
try_files /infomations/$1 /infomations/$1/ /subdir/index.php?topics&$1&$args;
|
68
152
|
|
69
153
|
|
70
154
|
|
@@ -74,172 +158,146 @@
|
|
74
158
|
|
75
159
|
|
76
160
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
in
|
161
|
+
|
162
|
+
|
163
|
+
location / {
|
164
|
+
|
165
|
+
try_files $uri $uri/ /index.php?$args;
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
location = /favicon.ico {
|
172
|
+
|
173
|
+
log_not_found off;
|
174
|
+
|
175
|
+
access_log off;
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
location ~* /\. {
|
182
|
+
|
183
|
+
deny all;
|
184
|
+
|
185
|
+
}
|
186
|
+
|
187
|
+
location ~* /(?:uploads|files)/.*\.php$ {
|
188
|
+
|
189
|
+
deny all;
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
location ~ [^/]\.php(/|$) {
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
200
|
+
|
201
|
+
if (!-f $document_root$fastcgi_script_name) {
|
202
|
+
|
203
|
+
return 404;
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
fastcgi_pass 127.0.0.1:9000;
|
208
|
+
|
209
|
+
fastcgi_index index.php;
|
210
|
+
|
211
|
+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
212
|
+
|
213
|
+
include fastcgi_params;
|
214
|
+
|
215
|
+
fastcgi_buffers 256 128k;
|
216
|
+
|
217
|
+
fastcgi_buffer_size 128k;
|
218
|
+
|
219
|
+
fastcgi_intercept_errors on;
|
220
|
+
|
221
|
+
fastcgi_read_timeout 120s;
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
set $do_not_cache 1; ## page cache
|
226
|
+
|
227
|
+
set $device "pc";
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
if ($request_method = POST) {
|
232
|
+
|
233
|
+
set $do_not_cache 1;
|
234
|
+
|
235
|
+
}
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
if ($query_string != "") {
|
240
|
+
|
241
|
+
set $do_not_cache 1;
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
|
248
|
+
|
249
|
+
set $do_not_cache 1;
|
250
|
+
|
251
|
+
}
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
|
256
|
+
|
257
|
+
set $do_not_cache 1;
|
258
|
+
|
259
|
+
}
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
if ($http_user_agent ~* " Android |\(iPad|Android; Tablet; .+Firefox") {
|
264
|
+
|
265
|
+
set $device "tablet";
|
266
|
+
|
267
|
+
}
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
if ($http_user_agent ~* " Android .+ Mobile |\(iPhone|\(iPod|IEMobile|Android; Mobile; .+Firefox|Windows Phone") {
|
272
|
+
|
273
|
+
set $device "smart";
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
fastcgi_cache wpcache;
|
280
|
+
|
281
|
+
fastcgi_cache_key "$device:$request_method:$scheme://$host$request_uri";
|
282
|
+
|
283
|
+
fastcgi_cache_valid 200 10m;
|
284
|
+
|
285
|
+
fastcgi_no_cache $do_not_cache;
|
286
|
+
|
287
|
+
fastcgi_cache_bypass $do_not_cache;
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
add_header X-F-Cache $upstream_cache_status;
|
292
|
+
|
293
|
+
add_header X-Signature KUSANAGI;
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
}
|
298
|
+
|
299
|
+
|
98
300
|
|
99
301
|
}
|
100
302
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
location / {
|
106
|
-
|
107
|
-
try_files $uri $uri/ /index.php?$args;
|
108
|
-
|
109
|
-
}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
location = /favicon.ico {
|
114
|
-
|
115
|
-
log_not_found off;
|
116
|
-
|
117
|
-
access_log off;
|
118
|
-
|
119
|
-
}
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
location ~* /\. {
|
124
|
-
|
125
|
-
deny all;
|
126
|
-
|
127
|
-
}
|
128
|
-
|
129
|
-
location ~* /(?:uploads|files)/.*\.php$ {
|
130
|
-
|
131
|
-
deny all;
|
132
|
-
|
133
|
-
}
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
location ~ [^/]\.php(/|$) {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
142
|
-
|
143
|
-
if (!-f $document_root$fastcgi_script_name) {
|
144
|
-
|
145
|
-
return 404;
|
146
|
-
|
147
|
-
}
|
148
|
-
|
149
|
-
fastcgi_pass 127.0.0.1:9000;
|
150
|
-
|
151
|
-
fastcgi_index index.php;
|
152
|
-
|
153
|
-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
154
|
-
|
155
|
-
include fastcgi_params;
|
156
|
-
|
157
|
-
fastcgi_buffers 256 128k;
|
158
|
-
|
159
|
-
fastcgi_buffer_size 128k;
|
160
|
-
|
161
|
-
fastcgi_intercept_errors on;
|
162
|
-
|
163
|
-
fastcgi_read_timeout 120s;
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
set $do_not_cache 1; ## page cache
|
168
|
-
|
169
|
-
set $device "pc";
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
if ($request_method = POST) {
|
174
|
-
|
175
|
-
set $do_not_cache 1;
|
176
|
-
|
177
|
-
}
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
if ($query_string != "") {
|
182
|
-
|
183
|
-
set $do_not_cache 1;
|
184
|
-
|
185
|
-
}
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
|
190
|
-
|
191
|
-
set $do_not_cache 1;
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
|
198
|
-
|
199
|
-
set $do_not_cache 1;
|
200
|
-
|
201
|
-
}
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
if ($http_user_agent ~* " Android |\(iPad|Android; Tablet; .+Firefox") {
|
206
|
-
|
207
|
-
set $device "tablet";
|
208
|
-
|
209
|
-
}
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
if ($http_user_agent ~* " Android .+ Mobile |\(iPhone|\(iPod|IEMobile|Android; Mobile; .+Firefox|Windows Phone") {
|
214
|
-
|
215
|
-
set $device "smart";
|
216
|
-
|
217
|
-
}
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
fastcgi_cache wpcache;
|
222
|
-
|
223
|
-
fastcgi_cache_key "$device:$request_method:$scheme://$host$request_uri";
|
224
|
-
|
225
|
-
fastcgi_cache_valid 200 10m;
|
226
|
-
|
227
|
-
fastcgi_no_cache $do_not_cache;
|
228
|
-
|
229
|
-
fastcgi_cache_bypass $do_not_cache;
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
add_header X-F-Cache $upstream_cache_status;
|
234
|
-
|
235
|
-
add_header X-Signature KUSANAGI;
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
}
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
}
|
244
|
-
|
245
303
|
```
|