• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

How to enable nginx for all domains?

nurullah_me"><hr>

New Pleskian
Hi friends,

I have installed the nginx on my server and want to activate it for all my domains, to do this, i have to do it manually for each domains. But there should be an easier way. Apache uses too much ram.
Could you show me please a way?

Thanks
 
Run /usr/local/psa/bin/domain --help and select needed nginx mode:

-nginx-transparent-mode <true|false>
Turns on/off the transparent mode for
the nginx reverse proxy server. In
this mode, Apache handles both static
and dynamic content, while nginx only
passes HTTP requests and responses
without modification. The default
value is "false".
-nginx-serve-static <true|false> Turns on/off serving static content by
the nginx reverse proxy server. The
default value is "false".
-nginx-static-extensions <extensions>
Sets static files extensions that
should be served directly by nginx. If
you specify an empty value, the static
files extensions from the default
nginx configuration
(/var/www/vhosts/domain1.tld/.plesk/conf/last_nginx.conf)
will be used. Use this option with the
-nginx-serve-static command.
-nginx-serve-php <true|false> Turns on/off processing PHP files by
the nginx reverse proxy server. The
default value is "false".

After that use script like:

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/domain -u $i -nginx-serve-static true;done

add there needed option for nginx mode.
 
Run /usr/local/psa/bin/domain --help and select needed nginx mode:

-nginx-transparent-mode <true|false>
Turns on/off the transparent mode for
the nginx reverse proxy server. In
this mode, Apache handles both static
and dynamic content, while nginx only
passes HTTP requests and responses
without modification. The default
value is "false".
-nginx-serve-static <true|false> Turns on/off serving static content by
the nginx reverse proxy server. The
default value is "false".
-nginx-static-extensions <extensions>
Sets static files extensions that
should be served directly by nginx. If
you specify an empty value, the static
files extensions from the default
nginx configuration
(/var/www/vhosts/domain1.tld/.plesk/conf/last_nginx.conf)
will be used. Use this option with the
-nginx-serve-static command.
-nginx-serve-php <true|false> Turns on/off processing PHP files by
the nginx reverse proxy server. The
default value is "false".

After that use script like:

# for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/domain -u $i -nginx-serve-static true;done

add there needed option for nginx mode.


Thanks, but i didn't understand how to use this script.
I'm not so good in SSH :/ i run the command

/usr/local/psa/bin/domain nginx-transparent-mode

but i get error. which script should i use, to enable nginx for all domains?
 
Just copy-paste this line in CLI and press Enter:

for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/domain -u $i -nginx-transparent-mode true;done

Of course if you need nginx transparent mode.
 
Just copy-paste this line in CLI and press Enter:

for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select name from domains"`; do /usr/local/psa/bin/domain -u $i -nginx-transparent-mode true;done

Of course if you need nginx transparent mode.
I think it didnt solve my problem.

I see now in the domain panel that nginx is still not checked.

So still running apache. I want the completly disable apache.

Am i doing something false?

I used the script which you wrote in your last post.

Please also see the attachment that nginx is still not active for domains.
 

Attachments

  • Bildschirmfoto 2014-11-20 um 17.04.32.png
    Bildschirmfoto 2014-11-20 um 17.04.32.png
    116.3 KB · Views: 1
It is not possible in Plesk completely disable apache. A lot of different webhosting features in Plesk connected with Apache. Nginx can work in different modes together with Apache but not standalone for webhosting.
 
Back
Top