server {
location / {
proxy_pass https://192.168.1.18/;
# proxy_pass_header Server;
proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $proxy_connection;
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/cloud.mysite.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/cloud.mysite.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
client_max_body_size 0;
location /.well-known/carddav {
return 301 $scheme://$host/remote.php/dav;
}
location /.well-known/caldav {
return 301 $scheme://$host/remote.php/dav;
}
}
server {
if ($host = www.cloud.mysite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = cloud.mysite.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name cloud.mysite.com www.cloud.mysite.com;
listen 80;
# listen 80 default_server;
# listen [::]:80 default_server;
return 404; # managed by Certbot
}