質問編集履歴

2

nginxのエラーログ追記

2018/11/01 07:38

投稿

chapter
chapter

スコア36

test CHANGED
File without changes
test CHANGED
@@ -220,6 +220,18 @@
220
220
 
221
221
 
222
222
 
223
+ ※nginxのエラーログ追記
224
+
225
+ ```Bash
226
+
227
+ [error] 25420#25420: *2886487 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: ***.***.***.***, server: sample.com, request: "GET /payment/eccube_install.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "sample.com"
228
+
229
+
230
+
231
+ [error] 25420#25420: *2886506 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: ***.***.***.***, server: sample.com, request: "GET /payment/html/install.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "sample.com"
232
+
233
+ ```
234
+
223
235
 
224
236
 
225
237
  3 nginxの設定ファイルの`location /`の前に以下を追加した場合

1

こちらで試してみた内容の追記

2018/11/01 07:38

投稿

chapter
chapter

スコア36

test CHANGED
File without changes
test CHANGED
@@ -132,6 +132,186 @@
132
132
 
133
133
 
134
134
 
135
+ ----------------------------------------------------
136
+
137
+
138
+
139
+ 当方にて試してみた内容を以下に追記させていただきます。
140
+
141
+
142
+
143
+ 1 nginxの設定ファイルを変更しない場合
144
+
145
+
146
+
147
+ 1.1
148
+
149
+ http://sample.com/payment/
150
+
151
+
152
+
153
+ にアクセスすると、cakePHP2のアプリのデフォルトのURLにリダイレクトされます。
154
+
155
+
156
+
157
+ http://sample.com/
158
+
159
+
160
+
161
+
162
+
163
+ 1.2
164
+
165
+ http://sample.com/payment/eccube_install.php
166
+
167
+ http://sample.com/payment/html/install.php
168
+
169
+
170
+
171
+ にアクセスすると、`File not found.`と表示されます。
172
+
173
+
174
+
175
+
176
+
177
+ 2 nginxの設定ファイルの`set $root_path`の前に以下を追加した場合
178
+
179
+
180
+
181
+ ```Bash
182
+
183
+ location /payment {
184
+
185
+ set $root_path '/var/www/html/payment/html';
186
+
187
+ try_files $uri $uri/ /index.php$uri;
188
+
189
+ }
190
+
191
+ ```
192
+
193
+
194
+
195
+ 2.1
196
+
197
+ http://sample.com/payment/
198
+
199
+
200
+
201
+ にアクセスすると、cakePHP2のアプリのデフォルトのURLにリダイレクトされます。
202
+
203
+
204
+
205
+ http://sample.com/
206
+
207
+
208
+
209
+
210
+
211
+ 2.2
212
+
213
+ http://sample.com/payment/eccube_install.php
214
+
215
+ http://sample.com/payment/html/install.php
216
+
217
+
218
+
219
+ にアクセスすると、`File not found.`と表示されます。
220
+
221
+
222
+
223
+
224
+
225
+ 3 nginxの設定ファイルの`location /`の前に以下を追加した場合
226
+
227
+
228
+
229
+ ```Bash
230
+
231
+ location /payment {
232
+
233
+ try_files $uri /index.php$is_args$args;
234
+
235
+ }
236
+
237
+
238
+
239
+ location ~ /payment/install/(.*).php/.+$ {
240
+
241
+ fastcgi_pass 127.0.0.1:9000;
242
+
243
+ fastcgi_index index.php;
244
+
245
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
246
+
247
+ fastcgi_param PATH_INFO $fastcgi_script_name;
248
+
249
+ include fastcgi_params;
250
+
251
+ try_files $uri $uri/ /install.php;
252
+
253
+
254
+
255
+ }
256
+
257
+
258
+
259
+ location ~ /payment/(.*).php {
260
+
261
+ fastcgi_pass 127.0.0.1:9000;
262
+
263
+ fastcgi_index index.php;
264
+
265
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
266
+
267
+ fastcgi_param PATH_INFO $fastcgi_script_name;
268
+
269
+ include fastcgi_params;
270
+
271
+ try_files $uri =404;
272
+
273
+ }
274
+
275
+ ```
276
+
277
+
278
+
279
+ 3.1
280
+
281
+ http://sample.com/payment/
282
+
283
+
284
+
285
+ にアクセスすると、cakePHP2のアプリのデフォルトのURLにリダイレクトされます。
286
+
287
+
288
+
289
+ http://sample.com/
290
+
291
+
292
+
293
+
294
+
295
+ 3.2
296
+
297
+ http://sample.com/payment/eccube_install.php
298
+
299
+ http://sample.com/payment/html/install.php
300
+
301
+
302
+
303
+ にアクセスすると、`404 Not Found`と表示されます。
304
+
305
+
306
+
307
+
308
+
309
+ なお、`/payment`の箇所を`^/payment`に変更しても同じでした。
310
+
311
+
312
+
313
+ ----------------------------------------------------
314
+
135
315
 
136
316
 
137
317
  なお、サーバ環境などは以下になります。