teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

informations

2017/08/19 07:39

投稿

Nanohana
Nanohana

スコア123

title CHANGED
File without changes
body CHANGED
@@ -3,7 +3,7 @@
3
3
  http://xxx.net/ →Wordpressを使用
4
4
  http://xxx.net/topics/ →Wordpressを使用
5
5
  http://xxx.net/topics/api/** →cakephpを使用
6
- http://xxx.net/infomations/ →Cakephpを使用
6
+ http://xxx.net/informations/ →Cakephpを使用
7
7
 
8
8
  cakephpのルートディレクトリは
9
9
  /var/www/html/xxx/app/webroot にあり、
@@ -24,13 +24,13 @@
24
24
  http://yyy.net/ →Wordpressを使用
25
25
  http://yyy.net/topics/ →Wordpressを使用
26
26
  http://yyy.net/topics/api/** →cakephpを使用
27
- http://yyy.net/infomations/ →Cakephpを使用
27
+ http://yyy.net/informations/ →Cakephpを使用
28
28
  という形にしたいため、wordpressが動いているxxx.netでNginxの設定をいじって
29
29
 
30
30
  http://xxx.net/ →Wordpressを使用
31
31
  http://xxx.net/topics/ →Wordpressを使用
32
32
  http://xxx.net/topics/api/** →cakephpを使用
33
- http://xxx.net/infomations/ →Cakephpを使用
33
+ http://xxx.net/informations/ →Cakephpを使用
34
34
  という構成で検証をして、問題なければyyy.netで同じような設定を導入しようと思っています。
35
35
 
36
36
 
@@ -66,7 +66,7 @@
66
66
 
67
67
 
68
68
 
69
- location /infomations {
69
+ location /informations {
70
70
  root /var/www/html/xxx/app/webroot;
71
71
  index index.php index.html;
72
72
  # try_files /topics/$1 /sample/$1/ /topics/index.php?$1&$args;
@@ -74,7 +74,7 @@
74
74
  fastcgi_pass 127.0.0.1:9000;
75
75
  fastcgi_index index.php;
76
76
  fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_script_name;
77
- try_files /infomations/$1 /infomations/$1/ /subdir/index.php?topics&$1&$args;
77
+ try_files /informations/$1 /informations/$1/ /subdir/index.php?informations&$1&$args;
78
78
 
79
79
  include fastcgi_params;
80
80
  }

2

追記

2017/08/19 07:39

投稿

Nanohana
Nanohana

スコア123

title CHANGED
File without changes
body CHANGED
@@ -15,10 +15,11 @@
15
15
  yyy.net/topics/api/** は現状でも見ることができるのですが、
16
16
  xxx.net/topics/api/** でもアクセスできるようにしたいと考えています。
17
17
 
18
- **なぜこの処置をするのか
18
+ なぜこの処置をするのか
19
- **
19
+
20
20
  現状、yyy.netとxxx.netで運営していてyyy.netではcakephp、
21
21
  xxx.netではwordpressを使っています。
22
+
22
23
  最終的に
23
24
  http://yyy.net/ →Wordpressを使用
24
25
  http://yyy.net/topics/ →Wordpressを使用

1

追記

2017/08/19 07:37

投稿

Nanohana
Nanohana

スコア123

title CHANGED
File without changes
body CHANGED
@@ -9,6 +9,33 @@
9
9
  /var/www/html/xxx/app/webroot にあり、
10
10
  /var/www/html/xxx/app/Controller/TopicsController.php にコントローラーはあるというような構成になっています
11
11
 
12
+ 現状の状況は以下の通りです。
13
+ WordPressは現状xxx.netで動いています。
14
+ CakePHPは現状yyy.net(別ドメイン)で動いています。(/var/www/html/xxx/app/webroot がルートディレクトリ)。
15
+ yyy.net/topics/api/** は現状でも見ることができるのですが、
16
+ xxx.net/topics/api/** でもアクセスできるようにしたいと考えています。
17
+
18
+ **なぜこの処置をするのか
19
+ **
20
+ 現状、yyy.netとxxx.netで運営していてyyy.netではcakephp、
21
+ xxx.netではwordpressを使っています。
22
+ 最終的に
23
+ http://yyy.net/ →Wordpressを使用
24
+ http://yyy.net/topics/ →Wordpressを使用
25
+ http://yyy.net/topics/api/** →cakephpを使用
26
+ http://yyy.net/infomations/ →Cakephpを使用
27
+ という形にしたいため、wordpressが動いているxxx.netでNginxの設定をいじって
28
+
29
+ http://xxx.net/ →Wordpressを使用
30
+ http://xxx.net/topics/ →Wordpressを使用
31
+ http://xxx.net/topics/api/** →cakephpを使用
32
+ http://xxx.net/infomations/ →Cakephpを使用
33
+ という構成で検証をして、問題なければyyy.netで同じような設定を導入しようと思っています。
34
+
35
+
36
+
37
+
38
+
12
39
  以下の設定でうまくいかないのですが、どのように設定すれば良いのでしょうか...
13
40
 
14
41
 
@@ -23,19 +50,21 @@
23
50
  root /home/kusanagi/xxx/DocumentRoot;
24
51
  index index.php index.html index.htm;
25
52
 
26
- location /topics/api {
53
+ location /topics/article{
27
- root /var/www/html/xxx/app/webroot;
54
+ root /var/www/html/xxx/app/webroot;
28
- index index.php index.html;
55
+ index index.php index.html;
29
56
  # try_files /topics/$1 /sample/$1/ /topics/index.php?$1&$args;
30
57
  #try_files $uri $uri?$args $uri/ /index.php?$uri&$args /index.php?$args;
31
58
  fastcgi_pass 127.0.0.1:9000;
32
59
  fastcgi_index index.php;
33
- fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_script_name;
60
+ fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_scr ipt_name;
34
- try_files /topics/$1 /topics/$1/ /subdir/index.php?topics&$1&$args;
61
+ try_files /topics/$1 /topics/$1/ /subdir/index.php?topics&$1&$args;
35
-
62
+ fastcgi_param PATH_INFO $fastcgi_path_info;
36
63
  include fastcgi_params;
37
64
  }
38
65
 
66
+
67
+
39
68
  location /infomations {
40
69
  root /var/www/html/xxx/app/webroot;
41
70
  index index.php index.html;