K
K
karelina-nat2020-11-30 08:55:04
Nginx
karelina-nat, 2020-11-30 08:55:04

What should I change in the nginx server config to correctly display the Wordpress multisite on subfolders?

After migrating the site to nginx, the main site works fine, but the one on the subfolder does not load resources (404 in the console), only HTML markup.
And the admin panel does not work for him, he says that the site has redirected too many times.
Apparently, some changes need to be made to the server configuration, but I still haven’t figured out which ones.
Main site: https://platinumstandardeducation.com/ Subfolder
site: https://platinumstandardeducation.com/eng

Server configuration

server {
  server_name platinumstandardeducation.com www.platinumstandardeducation.com;
  charset off;
  index index.php index.html;
  disable_symlinks if_not_owner from=$root_path;
  include /etc/nginx/vhosts-includes/*.conf;
  include /etc/nginx/vhosts-resources/platinumstandardeducation.com/*.conf;
  access_log off;
  error_log /dev/null crit;
  ssi on;
  return 301 https://$host:443$request_uri;
  set $root_path /var/www/platinumstandardeducation/data/www/platinumstandardeducation.com;
  root $root_path;
  listen 144.76.9.212:80;
  listen [2a01:4f8:190:84d3::2]:80;
location / {
  try_files $uri $uri/ /index.php?$args; # wp permalinks
  location ~ [^/]\.ph(p\d*|tml)$ {
    try_files /does_not_exists @php;
  }
}
  location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@platinumstandardeducation.com";
    fastcgi_pass unix:/var/www/php-fpm/platinumstandardeducation.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;
  }
}
server {
  server_name platinumstandardeducation.com www.platinumstandardeducation.com;
  ssl_certificate "/var/www/httpd-cert/platinumstandardeducation/platinum-se-5years.crtca";
  ssl_certificate_key "/var/www/httpd-cert/platinumstandardeducation/platinum-se-5years.key";
  ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
  ssl_prefer_server_ciphers on;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  add_header Strict-Transport-Security "max-age=31536000;";
  ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
  charset off;
  index index.php index.html;
  disable_symlinks if_not_owner from=$root_path;
  include /etc/nginx/vhosts-includes/*.conf;
  include /etc/nginx/vhosts-resources/platinumstandardeducation.com/*.conf;
  access_log off;
  error_log /dev/null crit;
  ssi on;
  set $root_path /var/www/platinumstandardeducation/data/www/platinumstandardeducation.com;
  root $root_path;
  listen 144.76.9.212:443 ssl;
  listen [2a01:4f8:190:84d3::2]:443 ssl;
location / {
  try_files $uri $uri/ /index.php?$args; # wp permalinks
  location ~ [^/]\.ph(p\d*|tml)$ {
    try_files /does_not_exists @php;
  }
}
  location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@platinumstandardeducation.com";
    fastcgi_pass unix:/var/www/php-fpm/platinumstandardeducation.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;
  }
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question