nginx Webサーバーを使用したTomcatによるWordPressサブディレクトリのインストール

nginx Webサーバーを使用したTomcatによるWordPressサブディレクトリのインストール

nginxプロキシパスを使用してデフォルトのWebサイトでtomcatを実行しています。これで、次のようにサブディレクトリと同じドメインにwordpressをインストールしようとしています。example.com/blog

私はnginxで次の設定を使用しています。

location /blog {

   root       /home/blog/html;
   index index.php index.htm index.html;
   try_files $uri $uri/ /blog/index.php?$args;


   }
  location ~ \.php$ {
        root     /home/blog/html;
        try_files $uri =404;
        fastcgi_buffers 16 16k;
        fastcgi_buffer_size 32k;
        fastcgi_read_timeout 200;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/blog-php-fpm.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
   location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
        access_log off;
        log_not_found off;
        expires 30d;
    }

WordPressのインストールページにアクセスすると、example.com/blog次のようになります。

http://example.com/wp-admin/setup-config.php

Tomcatを使用してWordPressを正しくインストールする方法は?

ベストアンサー1

wordpressサブディレクトリにあることを教えてください。wp-config.phpダッシュボードの代わりに使用し、スキームやドメイン名を含めません。

define( 'WP_SITEURL', '/blog' );
define( 'WP_HOME', '/blog' );

おすすめ記事