I created a shiny app in R that I'm hosting on a server at the 3838 port. I'm totally new to this, so I just followed tutorials. However, this problem has stumped even our brilliant IT guy.
My SSL is set up using lets encrypt and certbot for my website: www.example.com. However, if someone types in example.com, it doesn't redirect to the SSL, and instead takes me to a not secure privacy warning page. How can I get the non-www to redirect to the www? I'm running ubuntu 18.04.
if ($host = www.example.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name example.com www.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name example.com www.example.com;
ssl_certificate /etc/letsencrypt/live/www.example.com/fullchain.pem; # m$
ssl_certificate_key /etc/letsencrypt/live/www.example.com/privkey.pem; #$
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;
location / {
proxy_pass http://[IP Address]:3838;
proxy_redirect http://[IP Address]:3838/ https://$host/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 20d;
}```
I'm hosting on google domain and it is pointing at both www and the plain @.