I
I
i_want_to_know_everything2016-05-10 09:31:14
Nginx
i_want_to_know_everything, 2016-05-10 09:31:14

Wordpress CNC setup?

There is a site on WordPress, domain.com works under nginx
the rule for NC is registered In the domain.com/data directory , another wordpress installation is made, without the NC page at domain.com/data/?page=test - available With the inclusion of the NC domain. com/data/test/ naturally gives 404 to the main site. In this case, how to set the NC settings for Nginx so that when the NC is enabled on domain.com/data , everything works correctly the whole config
try_files $uri $uri/ /index.php?q=$request_uri;



server {
    listen 80;
  server_name domain.com *.domain.com www.domain.com;
  return 301 https://$host$request_uri;
}

server {
    listen 443;
  server_name domain.com *.domain.com www.domain.com;
  charset UTF-8;
  disable_symlinks if_not_owner from=$root_path;
  index index.php;
  root $root_path/$subdomain;
  set $root_path /var/www/user_name/data/www;
  set $subdomain domain.com;
      if ($host ~* ^((.*).domain.com)$) {
        set $subdomain $1;
      }
  access_log /var/www/httpd-logs/domain.com.access.log ;
  error_log /var/www/httpd-logs/domain.com.error.log notice;
  include /etc/nginx/vhosts-includes/*.conf;
  location / {
    location ~ [^/]\.ph(p\d*|tml)$ {
      try_files /does_not_exists @php;
    }
                  try_files $uri $uri/ /index.php?q=$request_uri;
  }
  location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@domain.com";
    fastcgi_pass unix:/var/www/php-fpm/user_name.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;
  }
  ssi on;
  add_header Strict-Transport-Security "max-age=31536000;";
  ssl on;
  ssl_certificate "/var/www/httpd-cert/user_name/domain.com.crtca";
  ssl_certificate_key "/var/www/httpd-cert/user_name/domain.com.key";
  ssl_ciphers HIGH:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!EXP:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
  ssl_prefer_server_ciphers on;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2016-05-11
@i_want_to_know_everything

Add before the location block @php {

location ~ /data(.*) {
    index index.php;
    try_files $uri /data/index.php?$1&$args;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question