nginx plugin

Started by fabian, June 10, 2018, 12:35:30 PM

Previous topic - Next topic
Hello!

I've some trouble while trying with multiple upstream servers:

nginx: [emerg] "upstream" directive is not allowed here in /usr/local/etc/nginx/nginx.conf:56
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed


I make a minor change in the upstream.conf jinja template that worked for me:

https://github.com/juliocbc/plugins/commit/82a47c38254691672a002a30e997d08d1e9a9b8e
Cloudfence Open Source Team

Could you please open a pull request so I can merge it?


I am waiting for the additional approval of Franco, then it will be in the next update.

Hi Franz!

I've opened a ISSUE: https://github.com/opnsense/plugins/issues/902

version: os-nginx-devel-1.1

If it is set TLS Certificate option in HTTP Server the following error occurs:

PHP Warning: Invalid argument supplied for foreach() in /usr/local/opnsense/scripts/nginx/setup.php on line 88
Cloudfence Open Source Team

Be sure Fabian is getting notified by any issue via Github :)

I tagged his user on the post!!

Thanks!
Cloudfence Open Source Team

fix is provided. Thanks for reporting.

October 09, 2018, 08:39:21 PM #38 Last Edit: October 09, 2018, 08:59:45 PM by juliocbc
@Fabian

Thanks!!

Now the error don't occurs anymore, but the /usr/local/etc/nginx/nginx.conf is don't being updated with the WebGUI configuration.

Is there some additional step?
Cloudfence Open Source Team

did you click on the reconfigure button (the one with the two arrows) and there is no error in the configd log?

Yes, I did it!

I didn't checked in configd.log (I was looking for errors on system.lof - Old habits  from 16.x  ::) )

Errors in configd.log:

Oct 10 10:37:36 OPNsense configd.py: [51c4c4a6-5895-47ff-b5de-136cd80f7624] Inline action failed with OPNsense/Nginx OPNsense/Nginx/nginx.conf 'None' has no attribute '@uuid' at Traceback (most recent call last):   File "/usr/local/opnsense/service/modules/processhandler.py", line 507, in execute     return ph_inline_actions.execute(self, inline_act_parameters)   File "/usr/local/opnsense/service/modules/ph_inline_actions.py", line 51, in execute     filenames = tmpl.generate(parameters)   File "/usr/local/opnsense/service/modules/template.py", line 332, in generate     raise render_exception Exception: OPNsense/Nginx OPNsense/Nginx/nginx.conf 'None' has no attribute '@uuid'
Cloudfence Open Source Team

this could be everything but I've provided a fix for that as far as I know in core. Did you delete anything?

Nope...

I'll try to make again the devel package with the latest commits then...

Cloudfence Open Source Team

The os-nginx-devel, I've get a new git clone from plugins repo and make again the package.

I've removed the packages os-nginx-devel and nginx and reinstalled both.

Am I missing something?
Cloudfence Open Source Team

are you also on opnsense devel?