I’ve got a reverse proxy so this is my nginx virtual host config :
upstream cloud {
server 10.8.0.2:80;
}
server {
server_name cloud.example.com;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location / {
location = /.well-known/carddav {
return 301 /remote.php/dav;
}
location = /.well-known/caldav {
return 301 /remote.php/dav;
}
add_header X-Served-By "My Servlet Handler";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
proxy_set_header Host $host:$server_port;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://cloud;
add_header Pragma "no-cache";
}
client_max_body_size 10240m;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/cloud.example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/cloud.example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = cloud.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name cloud.example.com;
listen 80;
return 404; # managed by Certbot
}
then my nextcloud config.php looks like this :
<?php
$CONFIG = array (
'instanceid' => 'instanceid',
'passwordsalt' => 'passwordsalt',
'secret' => 'secret',
'trusted_proxies' =>
array (
0 => '10.8.0.1',
),
'trusted_domains' =>
array (
0 => 'cloud.example.com',
),
'memcache.local' => '\\OC\\Memcache\\Redis',
'memcache.locking' => '\\OC\\Memcache\\Redis',
'redis' =>
array (
'host' => 'localhost',
'port' => 6379,
'timeout' => 0,
),
'default_phone_region' => 'UK',
'overwriteprotocol' => 'https',
'tempdirectory' => '/nextcloud_data/nextcloud_tmp',
'datadirectory' => '/nextcloud_data',
'dbtype' => 'pgsql',
'version' => '22.2.3.0',
'dbname' => 'nextclouddb',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'dbuser' => 'dbuser',
'dbpassword' => 'dbpassword',
'installed' => true,
'mail_smtpmode' => 'smtp',
'mail_smtpauth' => 1,
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'cloud',
'mail_domain' => 'example.com',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtphost' => 'aus.mx.com',
'mail_smtpport' => '587',
'mail_smtpsecure' => 'tls',
'mail_smtpname' => 'cloud@example.com',
'mail_smtppassword' => 'myverysecretpassword',
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'overwrite.cli.url' => 'http://cloud.example.com:443',
);
if i’m testing my website using ssllabs[dot]com
it’s showing as being A+ but at the end of the page I’m getting this :
HTTP request to this server failed, see below for details.
and
HTTP status code Request failed (Too many Redirection)