How to create custom Apache and nginx configuration files for all domains in Plesk

Follow

Comments

4 comments

  • Avatar
    Raoul STANISLAS

    Hello

    it's very easy to create customized nginx configuration files

    But where do we find the variables to use custom PHP settings ?

    In file /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php

    <?php if (!empty($VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'])): ?>
    client_max_body_size <?php echo $VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'] ?>;
    <?php endif ?>

    <?php if ($VAR->domain->physicalHosting->scriptTimeout): ?>
    proxy_read_timeout <?php echo min($VAR->domain->physicalHosting->scriptTimeout, 2147483) ?>;
    <?php endif ?>


    $VAR->domain->physicalHosting->scriptTimeout is value for field max_execution_time


    What is $VAR->domain->physicalHosting->??? to use value to field post_max_size or upload_max_filesize ?

    Thanks

     

     

    0
    Comment actions Permalink
  • Avatar
    Francisco Garcia

    Hi Raoul STANISLAS,

    These 3 settings are set in Plesk > Domains > example.com > PHP Settings.

    Also, can be done massively with: How to change PHP settings for one domain or all domain in Plesk using command line?

    0
    Comment actions Permalink
  • Avatar
    Raoul STANISLAS

    Hi Francisco Garcia,

    No commande line, I want to customize by domain and want to use a value in PHP settings.

    I don't want to use a global value like here.

    There are no "proxySettings[nginxClientMaxBodySize]" custom field in Plesk > Domains > example.com > Apache & Nginx Settings, so I want to use Plesk > Domains > example.com > PHP Settings > upload_max_filesize in my file /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php

    0
    Comment actions Permalink
  • Avatar
    Francisco Garcia

    Hi Raoul STANISLAS,

    One thing is completely different from the other, you're talking about PHP Settings, but then now you talk about Nginx MaxBodySize.

    I know one is related to the other, as if one increases, the other should also increase, but are completely different settings.

    For Nginx, this might be interesting for you https://support.plesk.com/hc/en-us/articles/213914565

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request