Tomato-RAF
Tomato-RAF copied to clipboard
nginx.c complete custom configuration persistence across reboot
nginx.c
Upon router reboot (via SSH or WebGUI), nginx.c is hardcoded to recreate default environment for nginx to initialize. Regardless of whether nginx_keepconf=1, the entire file is recreated. Therefore any changes made manually are lost.
I propose the entire file nginx.conf be derived from "Custom configuration" in TomatoGUI, with default parameters set upon flashing only.
This would give the user complete control over the configuration. As it stands, upon reboot, my "Custom configuration" is conflicts by recreated default settings as set forth in "nginx.c". I wish to use nginx as a reverse proxy and not a web server.
If I remember correctly custom config is included to the config file.. But I can add a rewrite check for sections that exists in the custom config which means that if you have a section included in custom config it will overwrite the default configuration , would that solve you issue ?
Ofer
Sent from my iPhone
On 28 בינו 2014, at 19:08, offbeatryan [email protected] wrote:
nginx.c
Upon router reboot (via SSH or WebGUI), nginx.c is hardcoded to recreate default environment for nginx to initialize. Regardless of whether nginx_keepconf=1, the entire file is recreated. Therefore any changes made manually are lost.
I propose the entire file nginx.conf be derived from "Custom configuration" in TomatoGUI, with default parameters set upon flashing only.
This would give the user complete control over the configuration. As it stands, upon reboot, my "Custom configuration" is conflicts by recreated default settings as set forth in "nginx.c". I wish to use nginx as a reverse proxy and not a web server.
— Reply to this email directly or view it on GitHub.
As Ofer mentioned it's correct, nginx.conf is created every time the service starts (if the Keep config file checkbox is unpicked) or after reboot (since it's written in /etc/tmp/nginx/niginx.conf). The method described by Ofer could work BUT we need to be careful with available nvram space (this is the reason for a hardcoded config file). Some routers like RT-N16 have less than 11KB free nvram size now, may be we have to consider a nvram compression. Have to test.
Vicente
At any case we'll need you config file to do some testing.. So please send it this can be useful for other stuff as well.. Dnscrypt/tor via nginx comes to mind ;)
We'll cross nvram size bridge when it'll come.
Ofer
Sent from my iPhone
On 28 בינו 2014, at 20:44, Victek [email protected] wrote:
As Ofer mentioned it's correct, nginx.conf is created every time the service starts (if the Keep config file checkbox is unpicked) or after reboot (since it's written in /etc/tmp/nginx/niginx.conf). The method described by Ofer could work BUT we need to be careful with available nvram space (this is the reason for a hardcoded config file). Some routers like RT-N16 have less than 11KB free nvram size now, may be we have to consider a nvram compression. Have to test.
Vicente
— Reply to this email directly or view it on GitHub.
Ideally what would be great would be that upon system start, Tomato initalizes some sort of default config (even the current one) but that is editable in it's entirety within. Upon save, it's stored in NVRAM for persistence. The problem as @Victek suggest is I have RT-N16. As of this writing my status is NVRAM Size / Free 32.00 KB / 8796 (26.84%).
Reverse proxy config is as basic as the following example: http://www.howtoforge.com/how-to-set-up-nginx-as-a-reverse-proxy-for-apache2-on-ubuntu-12.04
I don't know the best approach. nginx is a great module to include in Tomato, rather than using Entware to install nginx.
My apologies, I come from DD-WRT/Optware and I was using "pound" as my reverse proxy. This is my first time configuring nginx. At this time I'm still working on a good config. That is why I put the link above that I am using for reference.
I'm thinking about utilizing compression for various nvram variables, so it could be a possible solution for the size issue.
Ofer
Sent from my iPhone
On 28 בינו 2014, at 21:26, offbeatryan [email protected] wrote:
Ideally what would be great would be that upon system start, Tomato initalizes some sort of default config (even the current one) but that is editable in it's entirety within. Upon save, it's stored in NVRAM for persistence. The problem as @Victek suggest is I have RT-N16. As of this writing my status is NVRAM Size / Free 32.00 KB / 8796 (26.84%).
Reverse proxy config is as basic as the following example: http://www.howtoforge.com/how-to-set-up-nginx-as-a-reverse-proxy-for-apache2-on-ubuntu-12.04
I don't know the best approach. nginx is a great module to include in Tomato, rather than using Entware to install nginx.
— Reply to this email directly or view it on GitHub.