• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Change default file types served by nginx reverse proxy

entim

New Pleskian
We have been serving static files by nginx, dynamic files go to apache - as in default reverse proxy Plesk configuration.

Now I want to exclude 'html' files from static content. I have done it for chosen domain by adjusting smart files processing in nginx settings. But I want to set it globally for all vhosts. Is it possible? What config files shoud I change?

Regards!
 
Hello entim,

To do it for all domains, please use the following script:

mysql -uadmin -p`cat /etc/psa/.psa.shadow ` psa -N -e" select name from domains where webspace_id=0;"| while read i;do echo $i;/usr/local/psa/bin/subscription --update-web-server-settings $i -nginx-serve-static true -nginx-static-extensions "mp4 avi mp4";done

But firstly please test it for one domain, using the command: # /usr/local/psa/bin/subscription --update-web-server-settings domain.tld -nginx-serve-static true -nginx-static-extensions "mp4 avi mp4"
 
But it is the same solution as for single domain, but used in interated way. When new websites are set up, I would need to repeat the procedure, so it is not what I'm looking for.

Rather I need some configuration setup to be done in some general Nginx files. Do you think it is possible?
 
Back
Top