• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

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