opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
844 stars 638 forks source link

nginx not starting at boot #3034

Closed chlochlo78 closed 2 years ago

chlochlo78 commented 2 years ago

Important notices

Describe the bug:

  1. during daily restart with protectli appliance, service named & nginx does not restart because of a long refresh list from DNSCrypt-Proxy adguard-dns-ipv6 adguard-dns, and nginx upstream's name is not recognised due to named not started yet
  2. named forward all request to DNSCrypt-Proxy ( with adguard list )

To Reproduce

restarting all opnsense ( protectli 4 port )

Expected behavior

service named waiting start before all service, maybe

Describe alternatives you considered

1.manual start service nginx after named is up from Services => Nginx: Configuration ( start icône ) or 2.rename upstream server with ip instead of local fqdn ( need resolved name ipv4 and ipv6 from named ) or 3.using kloax in DNSCrypt-Proxy to fix upstream name's server ( ipv4/ipv6 ) <= does not work

  1. using 2 upstream server with ipv4 and ipv6 targetted from upstream's conf => working but hope using fqdn from named ( ipv4/ipv6 ) :)

Tip: to validate your setup was working with the previous version, use opnsense-revert (https://docs.opnsense.org/manual/opnsense_tools.html#opnsense-revert) => service nginx was not installed before OPNsense 22.1.10-amd64

Relevant log files

error log found at system log file => general /usr/local/etc/rc.d/nginx: WARNING: failed to start nginx_ 2022/07/10 14:03:04 [emerg] 27036#100188: host not found in upstream "doc.lan:443" in /usr/local/etc/nginx/nginx.conf:156

Additional context

using named forward to DNSCrypt-Proxy with list => adguard-dns-ipv6 adguard-dns

Environment

OPNsense 19.1.1 (amd64, OpenSSL). Intel® Xeon™ E3-1225V5 3.3Ghz Quad Core Network Intel® I210-AT

special thx :)

Great Job with Opnsense , Very Thx for everybody who works to this project

kulikov-a commented 2 years ago

Hi imho there is another option: try to use monit to monitor doc.lan:443 response and restart nginx. but imho there is not much benefit from using fqdn upstreams with free ("Open Source") nginx: fqdn is resolved once during process startup and for the whole time of work (need to restart nginx to resolve the name again)

chlochlo78 commented 2 years ago

hi, thx, i'v changed to use server's ip instead of fqdn in UPSTREAM SERVERS. FQDN was needed because one of peer ( ipad or iphone ) used dhcp with static mappings in unbound dns thx for your response