NGINX Reverse Proxy configuration
Hello,
I have installed the NGINX Reverse Proxy via the NGINX Manager of WHM with Caching enabled. I noticed that upon rebuilding the configuration of NGINX via the NGINX Manager some directives get the default values again. The directives that I'm interested in are the following:
1. At the file "/etc/nginx/nginx.conf" the directive "worker_processes" gets the value "1" upon rebuilding NGINX configuration.
2. At the file "/etc/nginx/conf.d/users/myusser.conf", the directive "http2" gets the value "off" upon rebuilding NGINX configuration for all the sections "server".
3. At the file "/etc/nginx/conf.d/users/myusser.conf", the directive "proxy_cache_path" should include the setting "use_temp_path=off" upon rebuilding NGINX configuration.
Is there anyway to achieve this with the files "/etc/nginx/ea-nginx/cache.json" and "/etc/nginx/ea-nginx/settings.json"?
For example, I could maintain the value of the "inactive" option for the directive "proxy_cache_path" by setting the value of the parameter "inactive_time" in the file "/etc/nginx/ea-nginx/cache.json". The problem is that I don't know the names of the other parameters that the file "cache.json" can accept. For instance the "inactive" option for the directive "proxy_cache_path" is named as "inactive_time" in the file "/etc/nginx/ea-nginx/cache.json" and not "inactive". Is there any documentation about the accepted parameters at the files "/etc/nginx/ea-nginx/cache.json" and "/etc/nginx/ea-nginx/settings.json"?
-
Hey there! Yes - details on how to customize the Nginx configuration so the values do not get overwritten can be found here for individual users:
and here for global settings:
https://docs.cpanel.net/knowledge-base/web-services/nginx-with-reverse-proxy/#configuration-files
0 -
Hello,
I checked the resources you suggested and I didn't find any information about the steps I should take so that when I rebuild the NGINX configuration via the command "/scripts/ea-nginx conf --all", then the generated configuration file "/etc/nginx/conf.d/users/myusser.conf" contain the below settings:
- the directive "proxy_cache_path" should include the setting "use_temp_path=off".
- the directive "http2" gets the value "on" instead of "off".
- the directive "worker_processes" found in the file "/etc/nginx/nginx.conf" gets the value "32" instead of "1".
0 -
Those main configuration files themselves will not change, as that isn't the intended behavior. The include files mentioned in the documentation get added in addition to the main etc/nginx/conf.d/users/myusser.conf and /etc/nginx/nginx.conf, as those main files don't change.
Does that help clear things up?
0 -
Indeed, I managed to change the files below upon rebuilding the configuration:
- /etc/nginx/nginx.conf
- /etc/nginx/conf.d/users/myusser.conf
Namely, I edited the file "/etc/nginx/ea-nginx/settings.json" and added the below line:
"worker_processes" : "32"
I also edited the file "/etc/nginx/ea-nginx/cache.json" and changed the below line as follows:
"inactive_time" : "7d"
These changes were propagated at the below files upon rebuilding the NGINX configuration (/scripts/ea-nginx conf --all):
- /etc/nginx/nginx.conf
- /etc/nginx/conf.d/users/myusser.conf
Isn't it possible to do the same for the directives below?
- use_temp_path = off
- http2 = on
0 -
You are welcome to add any directives that don't already exist, yes.
0 -
I have tried to add the below to the files settings.json and cache.json, but they didn't work:
- use_temp_path = off
- http2 = on
It may be the naming convention. I mean the below line which appears at the configuration file "/etc/nginx/conf.d/users/myusser.conf" contains the parameter "inactive" as follows:
proxy_cache_path /var/cache/ea-nginx/proxy/mysuser levels=1:2 keys_zone=mysuser:10m inactive=7d use_temp_path=off;
But, this parameter is named as "inactive_time" in the file "/etc/nginx/ea-nginx/cache.json", and not as "inactive". So, maybe the directives use_temp_path and http2 can be also specified in that file, but with different names.
So, the question is whether there is some documentation describing what directives / parameters can be specified in the below two files:
- /etc/nginx/ea-nginx/settings.json
- /etc/nginx/ea-nginx/cache.json
0 -
Let me see if I can get more specifics from the team about this issue as I'm not finding much about this on my end.
0 -
For http2 you'll just need to install the ea-nginx-http2 package, as that can't be enabled through a configuration.
We actually don't have a supported way to change the "use_temp_path" option at this time, so we may need to see a feature request in order to get something implemented to handle that. Is there a specific reason you wanted to change that value?
0
Please sign in to leave a comment.
Comments
8 comments