Wordpress multisite subdirectory nginx directives

Discussion in 'ISPConfig 3 Priority Support' started by mlnzigzag, Mar 7, 2022.

  1. mlnzigzag

    mlnzigzag New Member

    Hello,
    on Platforum Ubuntu 20.04 and latest ISPConfig, as the subject states, I have a wordpress blog running on a test subdomain testsite.example.com.
    I have the following nginx directives on:
    Code:
    client_max_body_size 64M;
    location / {
                    try_files $uri $uri/ /index.php?$args;
           }
    
           # Add trailing slash to */wp-admin requests.
           rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    
           location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                    expires max;
                    log_not_found off;
           }
    
    I was asked to enable wordpress multisite, for a second site that would be in /live/

    Anyway I'm unable to merge the configuration from this example to anything I would put in the "nginx directives" field in order to let it go.

    Can you please support in this?
    TY
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Don't put multiple installations into the same website if you like to have a stable production setup. Create one website for the test installation with subdomain test.yourdomain.tld and a second one for the live site with domain.test.tld. Or if you really want to have it in the same site, use a vhost subdomain or vhost aliasdomain in ISPConfig.
     
  3. mlnzigzag

    mlnzigzag New Member

    No, you got me wrong. There is a test site, and they asked me to turn it into a wordpress multisite. It does not involve any production. I have a separate server for production.

    current testsite: test.example.com
    the dev wants to turn it into a wordpress multisite and they state the next will be test.example.com/live

    I can't get map directives from the link to be accpeted.. is it actually possible to do this with ISPconfig?
     
  4. mlnzigzag

    mlnzigzag New Member

    Ok, looks like it didn't need any map directives:

    Code:
        # Pass uploaded files to wp-includes/ms-files.php.
        rewrite /files/$ /index.php last;
     
        if ($uri !~ wp-content/plugins) {
            rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
        }
     
        # Rewrite multisite '.../wp-.*' and '.../*.php'.
        if (!-e $request_filename) {
            rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
            rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
            rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
        }
    I fixed this way. Do you think it is of any concern?
     

Share This Page