On October 19, 2021, we have enabled single-sign-on for our Plesk Support Center to provide a seamless login/account experience. This implies that you’ll be able to use a single account across any of our web-facing properties.
If you had already registered your account at Plesk 360 (formerly known as My Plesk) please use one for login. Otherwise please re-register it using the same email address as your existing Zendesk login (support account). It’s essential that you use the same email address on our support center to ensure that your tickets stay attached to the same account.

How to update the "Additional nginx directives" field for all/several domains in Plesk

Follow

Comments

5 comments

  • Avatar
    Jason Schilling (Edited )

    I've got another workflow that set the directive, but it doesn't take effect.

    Even if I try to restart the nginx service with

    •     service nginx restart 

    I also checked the user and group and permission.(root:nginx and 644)

     

    // EDIT

    Works with

    /usr/local/psa/admin/sbin/httpdmng --reconfigure-domain <domain>

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    @Jason, thank you for noticing, the script will be updated soon.

    0
    Comment actions Permalink
  • Avatar
    Robert Perrett

    Is this really the only way to do this?  What about apache?

    0
    Comment actions Permalink
  • Avatar
    Alexandr Redikultsev

    Hi, @Robert Perrett.

    You can use the same approach as for nginx, but using vhost.conf and vhost_ssl.conf (for Additional Apache directives for HTTP and HTTPS correspondingly).

    As an alternative, you can add required directives to configuration template: Changing Virtual Hosts Settings Using Configuration Templates  

    0
    Comment actions Permalink
  • Avatar
    Chad Reitsma

    I did this with a slightly different approach. I created a tmp file with my directives then looped over the domains in .../vhosts/system/ to overwrite the existing vhost_nginx.conf, restart apache+nginx and you're done.

    5 Steps:

    # nano /tmp/vhost_nginx.conf   (pasted my directives into here and saved)
    # cd /var/www/vhosts/system/
    # for d in */; do cp /tmp/vhost_nginx.conf "./$d/conf"; done
    # service nginx restart
    # service httpd restart

    1
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request