Disable all HTTPS redirects (NC in TrueNAS jail behind Nginx reverse proxy)

Hi,

I’m running nextcloud in a jail on TrueNAS.
Nginx reverse proxy is supposed to handle https-stuff and then forward to nextcloud. Therefore, nextcloud needs to use http instead of https.
I was able to find quite a few promising topics on this forum, but I still wasn’t able to figure it out, unfortunately.

I think I need to change nextcloud.conf in /usr/local/etc/nginx/conf.d. Notice that this file is in the jail, so not associated with the nginx reverse proxy. Apparently Nginx is used as a webserver in this setup.
nextcloud.conf currently looks like this:
https://www.dropbox.com/sh/oj3qonmhar9rdpj/AAD7tttTnBBqhsMwWI4Dkhp9a?dl=0
I’m sorry those are pictures in a cloud. I wasn’t able to copy from the shell in TrueNAS’s web GUI and can only include 2 pictures because I’m a newbie. (In case indentations are confusing: it cointains only the two server {…} blocks)

This is my setup:
Nextcloud version: 22.2.0
Operating system and version : FreeBSD 12.2-RELEASE-p10 amd64
nginx version: nginx/1.20.1
PHP version: PHP 7.4.25

The output of my Nextcloud log for today

{"reqId":"Eim3HrMm5azEOUx8DluF","level":3,"time":"2021-11-06T07:54:26+00:00","remoteAddr":"192.168.0.104","user":"Yannick","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/weather_status/api/v1/forecast","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":415,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":380,"function":"requestJSON","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":358,"function":"forecastRequest","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Controller/WeatherStatusController.php","line":118,"function":"getForecast","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getForecast","class":"OCA\\WeatherStatus\\Controller\\WeatherStatusController","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"Eim3HrMm5azEOUx8DluF","level":3,"time":"2021-11-06T07:54:26+00:00","remoteAddr":"192.168.0.104","user":"Yannick","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/weather_status/api/v1/forecast","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":415,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":380,"function":"requestJSON","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":358,"function":"forecastRequest","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Controller/WeatherStatusController.php","line":118,"function":"getForecast","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getForecast","class":"OCA\\WeatherStatus\\Controller\\WeatherStatusController","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"kchCebCD5Cmq1bQBO6b7","level":3,"time":"2021-11-06T07:55:03+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"--","version":"22.2.0.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":226,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":187,"function":"queryLookupServer","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":117,"function":"verifyViaLookupServer","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/lib/public/BackgroundJob/Job.php","line":79,"function":"run","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":98,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/usr/local/www/nextcloud/cron.php","line":127,"function":"execute","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"sNLWk0W1JKKWOaXmHR86","level":3,"time":"2021-11-06T09:00:02+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"--","version":"22.2.0.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":226,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":187,"function":"queryLookupServer","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":117,"function":"verifyViaLookupServer","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/lib/public/BackgroundJob/Job.php","line":79,"function":"run","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":98,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/usr/local/www/nextcloud/cron.php","line":127,"function":"execute","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"tSr5iqlihK38lbRivFN6","level":3,"time":"2021-11-06T09:30:48+00:00","remoteAddr":"192.168.0.104","user":"Yannick","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/weather_status/api/v1/forecast","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":415,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":380,"function":"requestJSON","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":358,"function":"forecastRequest","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Controller/WeatherStatusController.php","line":118,"function":"getForecast","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getForecast","class":"OCA\\WeatherStatus\\Controller\\WeatherStatusController","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"tSr5iqlihK38lbRivFN6","level":3,"time":"2021-11-06T09:30:48+00:00","remoteAddr":"192.168.0.104","user":"Yannick","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/weather_status/api/v1/forecast","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0","version":"22.2.0.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":415,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":380,"function":"requestJSON","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":358,"function":"forecastRequest","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Controller/WeatherStatusController.php","line":118,"function":"getForecast","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getForecast","class":"OCA\\WeatherStatus\\Controller\\WeatherStatusController","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}
{"reqId":"piNFnMVLNmkn0bv7X2V0","level":3,"time":"2021-11-06T10:05:03+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"--","version":"22.2.0.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\\Http\\Client\\{closure}","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":226,"function":"get","class":"OC\\Http\\Client\\Client","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":187,"function":"queryLookupServer","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":117,"function":"verifyViaLookupServer","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/lib/public/BackgroundJob/Job.php","line":79,"function":"run","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"},{"file":"/usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php","line":98,"function":"execute","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/usr/local/www/nextcloud/cron.php","line":127,"function":"execute","class":"OCA\\Settings\\BackgroundJobs\\VerifyUserData","type":"->"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}

The output of my config.php file:
config_php1

I appreciate any help towards solving this problem and will be happy to provide more information if I missed something in this post!

Best,
Yannick

Hi Yannick,

I ran into excactly the same problem after I decided to update / reinstall NextCloud on my TrueNas this weekend. I really hoped, that someone would find a solution to your question…
My setup is probably similar: NextCloud is running in a IO-Cage directly on TrueNas, Nginx Proxy Manger handels all the proxy stuff from an ubuntu virtual machine.

I was able to connect to my nextcloud within my network, but couldn’t get my proxy to work. I tried different methods:

  • adjusting the /nginx/conf.d nexctloud.conf and nextcloud.conf.template file so there would be no forwarding. This is way beyond my technical expertise, so i reverted back to the original files.
  • disabling the proxy to check, wether that would somehow solve the problem. This was already prone to fail, so I abandoned that solution quite quickly.
  • cursing at my screen helped with the frustration but somehow didn’t fix the problem
  • etc.

I finally tried to add my proxy not only to the list of the “trusted_proxies” but also to the array of Trusted Domains… In your case that would be the [‘192.168.0.105’] Additionally I configured my proxy manger to forward directly to 8283 instead of 8282. This did the trick. Now everything works…

I hope that helps!