I have followed the guide on setting up NextCloud and Letsencrypt from linuxserver.io.
Everything is working, except I can only connect to NextCloud via https://nextcloud.mydomain.com. I am unable to access it from:
https://www.nextlcoud.mydomain.com
nextlcoud.mydomain.com
www.nextlcoud.mydomain.com
http://nextlcoud.mydomain.com
http://www.nextlcoud.mydomain.com
In every scenario, the server is not found. Is there something wrong in my configs? or could this potentially be an issue with the DNS routing of my subdomain?
My default nginx config looks like:
server {
listen 80;
server_name *.mydomain.com;
return 301 https://$host$request_uri;
}
# main server block
server {
listen 443 ssl default_server;
root /config/www;
index index.html index.htm index.php;
server_name _;
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
ssl_dhparam /config/nginx/dhparams.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM$
ssl_prefer_server_ciphers on;
client_max_body_size 0;
location / {
try_files $uri $uri/ /index.html /index.php?$args =404;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# With php7-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php7-fpm:
#fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
My NextCloud nginx config looks like:
server {
listen 443 ssl;
server_name nextcloud.mydomain.com;
root /config/www;
index index.html index.htm index.php;
###SSL Certificates
ssl_certificate /config/keys/letsencrypt/fullchain.pem;
ssl_certificate_key /config/keys/letsencrypt/privkey.pem;
###Diffie–Hellman key exchange ###
ssl_dhparam /config/nginx/dhparams.pem;
###SSL Ciphers
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA$
###Extra Settings###
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
### Add HTTP Strict Transport Security ###
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
add_header Front-End-Https on;
client_max_body_size 0;
location / {
proxy_pass https://my.unraid.server.ip:444/;
proxy_max_temp_file_size 2048m;
include /config/nginx/proxy.conf;
}
}
My NextCloud config.php looks like:
<?php
$CONFIG = array (
'memcache.local' => '\\OC\\Memcache\\APCu',
'datadirectory' => '/data',
'instanceid' => '***',
'passwordsalt' => '***',
'secret' => '***',
'trusted_domains' =>
array (
0 => 'my.unraid.server.ip:444',
1 => 'nextcloud.mydomain.com',
),
'overwrite.cli.url' => 'https://nextcloud.mydomain.com',
'overwritehost' => 'nextcloud.mydomain.com',
'overwriteprotocol' => 'https',
'dbtype' => 'mysql',
'version' => '12.0.4.3',
'dbname' => 'nextcloud',
'dbhost' => 'my.unraid.server.ip:3306',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'user',
'dbpassword' => 'password',
'installed' => true,
);