Our features site is undergoing a refresh! Be sure to explore the revamped site and discover our latest product roadmap launching here on Monday, March 18th.

cPanel Wide Customization of NGINX Server Blocks

Timothy Butler shared this idea 13 months ago
Needs Review

As a system administrator, I would like to be able to customize my user's NGINX directives globally rather than only individually. There are quite a few use cases where it would be desirably to add NGINX directives for all users' server blocks and not just one user at a time.

For example, cPanel does not implement Google's "best practices" for sending long "Expires" headers for static content to enable browsers to cache that content for longer periods of time. While Google's recommendation may cause unexpected issues in limited cases and thus it makes sense that cPanel has not made it the default, if knowing this, I would like to implement that as a default on my server, it'd be nice to be able to do so without having to create a conf.d/users/{USERNAME}/cache.conf file for each and every user manually.

This could be implemented simply using the same procedure cPanel handles a lot of its configuration directives in NGINX, simply adding a global server block template directory and then adding this to the standard template (where "everyUser" is the name of a directory that includes such directives):

include conf.d/everyUser/*.conf;

Leave a Comment
 
Attach a file