Nginxを使っているサーバーで以下のような運用をしたいと思います。
http://xxx.net/ →Wordpressを使用
http://xxx.net/topics/ →Wordpressを使用
http://xxx.net/topics/api/** →cakephpを使用
http://xxx.net/informations/ →Cakephpを使用
cakephpのルートディレクトリは
/var/www/html/xxx/app/webroot にあり、
/var/www/html/xxx/app/Controller/TopicsController.php にコントローラーはあるというような構成になっています
現状の状況は以下の通りです。
WordPressは現状xxx.netで動いています。
CakePHPは現状yyy.net(別ドメイン)で動いています。(/var/www/html/xxx/app/webroot がルートディレクトリ)。
yyy.net/topics/api/** は現状でも見ることができるのですが、
xxx.net/topics/api/** でもアクセスできるようにしたいと考えています。
〜なぜこの処置をするのか〜
現状、yyy.netとxxx.netで運営していてyyy.netではcakephp、
xxx.netではwordpressを使っています。
最終的に
http://yyy.net/ →Wordpressを使用
http://yyy.net/topics/ →Wordpressを使用
http://yyy.net/topics/api/** →cakephpを使用
http://yyy.net/informations/ →Cakephpを使用
という形にしたいため、wordpressが動いているxxx.netでNginxの設定をいじって
http://xxx.net/ →Wordpressを使用
http://xxx.net/topics/ →Wordpressを使用
http://xxx.net/topics/api/** →cakephpを使用
http://xxx.net/informations/ →Cakephpを使用
という構成で検証をして、問題なければyyy.netで同じような設定を導入しようと思っています。
以下の設定でうまくいかないのですが、どのように設定すれば良いのでしょうか...
lang
1server { 2 listen 80; 3 server_name xxx.net; 4 access_log /home/kusanagi/xxx/log/nginx/access.log main; 5 error_log /home/kusanagi/xxx/log/nginx/error.log warn; 6 charset UTF-8; 7 client_max_body_size 16M; 8 root /home/kusanagi/xxx/DocumentRoot; 9 index index.php index.html index.htm; 10 11location /topics/article{ 12root /var/www/html/xxx/app/webroot; 13index index.php index.html; 14# try_files /topics/$1 /sample/$1/ /topics/index.php?$1&$args; 15#try_files $uri $uri?$args $uri/ /index.php?$uri&$args /index.php?$args; 16fastcgi_pass 127.0.0.1:9000; 17fastcgi_index index.php; 18fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_scr ipt_name; 19try_files /topics/$1 /topics/$1/ /subdir/index.php?topics&$1&$args; 20fastcgi_param PATH_INFO $fastcgi_path_info; 21include fastcgi_params; 22} 23 24 25 26location /informations { 27 root /var/www/html/xxx/app/webroot; 28 index index.php index.html; 29# try_files /topics/$1 /sample/$1/ /topics/index.php?$1&$args; 30#try_files $uri $uri?$args $uri/ /index.php?$uri&$args /index.php?$args; 31fastcgi_pass 127.0.0.1:9000; 32fastcgi_index index.php; 33fastcgi_param SCRIPT_FILENAME /var/www/html/xxx/app/webroot/$fastcgi_script_name; 34 try_files /informations/$1 /informations/$1/ /subdir/index.php?informations&$1&$args; 35 36include fastcgi_params; 37} 38 39 40 location / { 41 try_files $uri $uri/ /index.php?$args; 42 } 43 44 location = /favicon.ico { 45 log_not_found off; 46 access_log off; 47 } 48 49 location ~* /\. { 50 deny all; 51 } 52 location ~* /(?:uploads|files)/.*\.php$ { 53 deny all; 54 } 55 56 location ~ [^/]\.php(/|$) { 57 58 fastcgi_split_path_info ^(.+?\.php)(/.*)$; 59 if (!-f $document_root$fastcgi_script_name) { 60 return 404; 61 } 62 fastcgi_pass 127.0.0.1:9000; 63 fastcgi_index index.php; 64 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 65 include fastcgi_params; 66 fastcgi_buffers 256 128k; 67 fastcgi_buffer_size 128k; 68 fastcgi_intercept_errors on; 69 fastcgi_read_timeout 120s; 70 71 set $do_not_cache 1; ## page cache 72 set $device "pc"; 73 74 if ($request_method = POST) { 75 set $do_not_cache 1; 76 } 77 78 if ($query_string != "") { 79 set $do_not_cache 1; 80 } 81 82 if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") { 83 set $do_not_cache 1; 84 } 85 86 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)") { 87 set $do_not_cache 1; 88 } 89 90 if ($http_user_agent ~* " Android |\(iPad|Android; Tablet; .+Firefox") { 91 set $device "tablet"; 92 } 93 94 if ($http_user_agent ~* " Android .+ Mobile |\(iPhone|\(iPod|IEMobile|Android; Mobile; .+Firefox|Windows Phone") { 95 set $device "smart"; 96 } 97 98 fastcgi_cache wpcache; 99 fastcgi_cache_key "$device:$request_method:$scheme://$host$request_uri"; 100 fastcgi_cache_valid 200 10m; 101 fastcgi_no_cache $do_not_cache; 102 fastcgi_cache_bypass $do_not_cache; 103 104 add_header X-F-Cache $upstream_cache_status; 105 add_header X-Signature KUSANAGI; 106 107 } 108 109}

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/08/19 07:40
2017/08/19 09:52
2017/08/19 10:07
2017/08/19 17:20
2017/08/20 09:43
2017/08/21 17:14
2017/08/22 16:02
2017/08/23 12:38