I am following this this tutorial to try and get NextCloud working remotely, but I am getting a "refuse to connect" error when trying to access Nextcloud through my domain.
During setup of everything, I get an error (another post) when I tried to add --network my-net to Extra arguments both in the nextcloud and letsencrypt containers. For the letsencrypt container, however, I am successfully able to add --cap-add=NET_ADMIN to Extra arguments. From my previous thread I created, I am pretty sure that the work around to the Extra arguments error I got was to go to the tab Networks in Docker, and then click on my-net to highlight it, and then click "Connect," and choose "nextcloud", leave everything else blank, and click save. And then do it all again and choose "letsencrypt." Then under "containers" in my-net, it shows "nextcloud,letsencrypt". This is the correct thing to do, right? If not, maybe that's what is causing me to not connect to my Nextcloud with my dns domain?
Another thing that happens, and doesn't go according to what the tutorial shows, is when I go to create certificates using the command docker logs -f letsencrypt. I do get (my DNS domain redacted):
Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/myserver.domain.org/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/myserver.domain.org/privkey.pem
However, after it says, "If you like Certbot, please consider supporting our work by" (and then some websites), this is what happens:
New certificate generated; starting nginx
creating GeoIP2 database
[cont-init.d] 50-config: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found:
no field package.preload['resty.core']
no file './resty/core.lua'
no file '/usr/share/luajit-2.1.0-beta3/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core/init.lua'
no file '/usr/share/lua/5.1/resty/core.lua'
no file '/usr/share/lua/5.1/resty/core/init.lua'
no file '/usr/share/lua/common/resty/core.lua'
no file '/usr/share/lua/common/resty/core/init.lua'
no file './resty/core.so'
no file '/usr/local/lib/lua/5.1/resty/core.so'
no file '/usr/lib/lua/5.1/resty/core.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/usr/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so')
Server ready
Alles anzeigen
I checked \AppData\Letsencrypt\etc\letsencrypt\live\myserver.domain.org and see fullchain.pem and privkey.pem there. At this point, if I use a port checker tool, ports 80 and 443 are open, and I can go to my domain in my browser and it shows "Welcome to our server". As soon as I edit nextcloud.subdomain.conf.sample and save it as nextcloud.subdomain.conf and restart the letsencrypt container, port 80 & 443 are blocked and my domain I'm trying to access refuses to connect. But I can continue to get into my Nexcloud using https://localipaddress:444. Here is everything that it is in my nextcloud.subdomain.conf file (it looks slightly different than what's in the video; it has an extra line with listen [::]:443 ssl;
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name myserver.*;
include /config/nginx/ssl.conf;
client_max_body_size 0;
location / {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_nextcloud nextcloud;
proxy_max_temp_file_size 2048m;
proxy_pass https://$upstream_nextcloud:443;
}
}
Alles anzeigen
If I continue with the tutorial and navigate to /sharedfolders/AppData/Nextcloud/www/nextcloud/config/ and try to open the config.php file with Notepad ++, it says "Can not open file." So I have to navigate to the config folder and use nano to edit config.php. After this, I still get a refuse to connect error, but I also can't get into my Nextcloud with the local IP address (it redirects to the subdomain, as expected after changed the config.php file).
So how do I narrow down where the problem is, and where do I begin to fix it?