質問編集履歴

2

解決策の追加

2015/12/14 03:10

投稿

p_np
p_np

スコア39

test CHANGED
File without changes
test CHANGED
@@ -66,7 +66,7 @@
66
66
 
67
67
 
68
68
 
69
- location ~ \.php$ {
69
+ location ~ \.php$ { #location ~ [^/]\.php(/|$) { に変えることで解決しました
70
70
 
71
71
  root /var/www/html;
72
72
 

1

nginxの設定内容を追記

2015/12/14 03:10

投稿

p_np
p_np

スコア39

test CHANGED
File without changes
test CHANGED
@@ -17,3 +17,77 @@
17
17
 
18
18
 
19
19
  解決策をご存知でしたらお教え下さい。
20
+
21
+
22
+
23
+ [追記]nginxの設定内容です(default.conf)
24
+
25
+ confを記載している時に気づいたのですが、`location ~ \.php$`に原因があるのかなと思いました。
26
+
27
+ しかし`****.php/****/`に対応させるにはどう書けばよいのか分かりません。
28
+
29
+ ```ここに言語を入力
30
+
31
+ server {
32
+
33
+ client_max_body_size 20m;
34
+
35
+ listen 80 ssl http2; #実際はは80番では運用しません
36
+
37
+ ssl_certificate *****;
38
+
39
+ ssl_certificate_key ****;
40
+
41
+ server_name ****;
42
+
43
+ gzip on;
44
+
45
+ gzip_types text/css text/javascript;
46
+
47
+ location / {
48
+
49
+ root /var/www/html
50
+
51
+ index index.html index.php;
52
+
53
+ }
54
+
55
+
56
+
57
+ #error_page 404 /404.html;
58
+
59
+ error_page 500 502 503 504 /50x.html;
60
+
61
+ location = /50x.html {
62
+
63
+ root /usr/share/nginx/html;
64
+
65
+ }
66
+
67
+
68
+
69
+ location ~ \.php$ {
70
+
71
+ root /var/www/html;
72
+
73
+ fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; #ソケットを使っています .phpで終わるものはアクセスできます
74
+
75
+ fastcgi_index index.php;
76
+
77
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
78
+
79
+ include fastcgi_params;
80
+
81
+ }
82
+
83
+ location ~ /\.ht {
84
+
85
+ deny all;
86
+
87
+ }
88
+
89
+
90
+
91
+ }
92
+
93
+ ```