サーバー移行でのkusanagi9 リンクページ404 解消について
TOP › Forums › 使い方全般(Fixing KUSANAGI) › サーバー移行でのkusanagi9 リンクページ404 解消について
サーバー移行でのkusanagi9 リンクページ404 解消について
- This topic has 4 replies, 2 voices, and was last updated 2 years, 10 months ago by cloudy. 
- 
		AuthorPosts
- 
		
			- 
2022年12月15日 at 16:35 #1128お世話になっております。 
 サイトを調べても解決できないため、ご存じの方がいらっしゃれば情報を頂きたいです。wordpress サイトの 
 サーバー移行を行っておりまして
 データ移行のプラグインを使用し、
 TOPは表示されたのですが、
 固定ページ以下が 404 not found
 になります。移行先は 
 KUSANAGI Version 9.2.14-1.el8
 conoha VPS
 nginx : nginx123
 php : php74
 mariadb : mariadb10.5で構築しました。 移行元は 
 Apache
 php72になります。 パーマリンクを基本にすると表示されます。 調べまして 
 https://qiita.com/kagayama_b/items/ea9e3a5b95fe2a51a7e6のような事象だと思われるのですが、 kusanagi9 の場合、該当のフォルダが見当たりません。 
 上記内容で対応できる場合、該当ファイルはどこにござますでしょうか。let's encrypt でSSL 設定とリダイレクト設定 
 ステージサイトで公開設定をしております。サイト全体にbasic認証をかけております。 その他関係しそうなところで変更を加えているのは 
 /etc/opt/kusanagi/nginx/conf.d/〇〇/wp.inc
 でサイト全体にbasic認証をかけております。location / { 
 try_files $uri $uri/ /index.php?$args;
 }location ~* /\. { 
 allow all;
 }location ~* /(?:uploads|files)/.*\.php$ { 
 allow all;
 }location ~* / { 
 satisfy any;
 allow 〇〇〇〇;
 allow 127.0.0.1;
 deny all;
 auth_basic "basic authentication";
 auth_basic_user_file "/home/kusanagi/.htpasswd";location ~ [^/]\.php(/|$) { 
 include conf.d/ratelimit.inc;
 include conf.d/fastcgi.inc;
 #include naxsi.d/wordpress/*.conf;
 }
 #include conf.d/ssl_st.inc;
 #include naxsi.d/wordpress/*.conf;
 }
- 
2022年12月15日 at 17:28 #1130uppie123 さん、こんにちは。 > kusanagi9 の場合、該当のフォルダが見当たりません。 
 > 上記内容で対応できる場合、該当ファイルはどこにござますでしょうか。これは、具体的に記事のどの部分のことを指していますでしょうか? 
 記事内容から引用していただけますでしょうか?
 質問者と回答者の間に齟齬がなくなり、どのファイルの何を問題にしているのか確認しやすくなると思います。また、移設前が Apache で 移設後が Nginx ということですが、KUSANAGI 9 側に移設後にまず Apache で動作確認されましたでしょうか? 
 要は、Apache でそのまま移設したらすんなり動くけど、Nginx 設定に移植すると動かないのかを確認したいです。
- 
2022年12月15日 at 17:43 #1131ご返信 ありがとうござます。 行いたかったことが、 パス ファイル名 
 /etc/nginx/nginx.conf
 において施策内容 
 server {
 server_name wordpress-replace.testtotest.com; # managed by Certbot
 root /usr/share/nginx/html/wordpress;# Load configuration files for the default server block. 
 include /etc/nginx/default.d/*.conf;location / { 
 }部分を server { 
 server_name wordpress-replace.testtotest.com; # managed by Certbot
 root /usr/share/nginx/html/wordpress;# Load configuration files for the default server block. 
 include /etc/nginx/default.d/*.conf;location / { 
 try_files $uri $uri/ /index.php?$args; //ここを追記する
 }という個所です。 Nginx での設定を第一に考え、Apacheでの検証はまだ行っておりません。 
 ご確認ください。
- 
2022年12月16日 at 10:32 #1136お世話になります 
 コメントに頂きました
 apache へ変更したらどうなるかですが、
 本日行いました。SSHにて kusanagi httpd を実行 再起動後確認しますと 
 リンククリックはできました。ご確認下さい。 
- 
2022年12月16日 at 13:32 #1138uppie123 さん、こんにちは。 Apache での検証は問題ないということでしたので、Nginx 設定で間違いなさそうですね。 KUSANAGI 9 での Nginx conf の場所です。 
 kusanagi provision で作成したプロファイル名を sample として説明します。sample プロファイルを WordPress でプロビジョンした場合、下記の設定ファイルが主に関係してきます。 /etc/opt/kusanagi/nginx/conf.d/sample.conf 
 /etc/opt/kusanagi/nginx/conf.d/sample.wp.incこの中で WordPress の設定を変更するのであれば、sample.wp.inc のファイルです。 
 ただ、指摘のあった内容はすでに sample.wp.inc に書かれているはずです。location / { 
 try_files $uri $uri/ /index.php?$args;
 }ですので、原因の予想がそもそもはずれていると思われます。 
 
- 
- 
		AuthorPosts
- You must be logged in to reply to this topic.
