set $proxy_https '';
if ($http_x_forwarded_proto = 'https') { set $proxy_https 'on'; }
if ($http_cloudfront_forwarded_proto = 'https') { set $proxy_https 'on'; }
if ($scheme = 'https') { set $proxy_https 'on'; }
rewrite ^(/[^/]+)/files/$ $1/index.php last;
rewrite ^(/[^/]+)/[_0-9a-zA-Z-]+/files/$ $1/index.php last;
if (!-e $request_filename) {
rewrite ^(/[^/]+)/[_0-9a-zA-Z-]+/wp-json/.*$ $1/index.php$is_args$args last;
rewrite ^(/[^/]+)/[_0-9a-zA-Z-]+(/wp-.*)$ $1$2 last;
rewrite ^(/[^/]+)/[_0-9a-zA-Z-]+(/wp-admin/.*\.php)$ $1$2 last;
rewrite ^(/[^/]+)/[_0-9a-zA-Z-]+(/.*\.php)$ $1$2 last;
rewrite ^(/[^/]+)/[_0-9a-zA-Z-]+/?.*$ $1/index.php$is_args$args last;
}
location ~ ^(/[^/]+)/.*$ { try_files $uri $uri/ $1/index.php$is_args$args; }
location / { try_files $uri $uri/ /index.php$is_args$args; }
location ~ \.php$ {
expires off;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass phpfpm;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS $proxy_https if_not_empty;
fastcgi_param HTTP_PROXY "";
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_busy_buffers_size 32k;
fastcgi_temp_file_write_size 256k;
}
More than 3 years have passed since last update.
[WordPress][Nginx] サブディレクトリにサブディレクトリ型のマルチサイトWordPressを設置する際の Nginx 設定
Posted at
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme