Hello!
I'm trying to setup a vaultwarden docker-compose on my ubuntu server using nginx as a proxy.
I managed to get everything working on HTTP only. I was able to connect to my server using my domain DNS. This was my original config in
/etc/nginx/sites-enabled/default
server {
listen 80;
server_name 4968431.xyz www.4968431.xyz;
location / {
proxy_pass http://192.168.0.200:8000; # bitwarden server address
}
}
after running the sudo certbot --nginx
,
This is what the file looks like:
server {
server_name 4968431.xyz www.4968431.xyz;
# root /var/www/example.com;
# index index.html;
location / {
proxy_pass http://192.168.0.200:8000; #bitwarden (vaultwarden)
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/www.4968431.xyz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/www.4968431.xyz/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 = www.4968431.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = 4968431.xyz) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name 4968431.xyz www.4968431.xyz;
return 404; # managed by Certbot
}
The website becomes unavailable afterwards.
I have Nginx Full enabled in my firewall and have tried restarting and reloading the nginx files with
sudo nginx -t && sudo nginx -s reload
and
sudo systemctl restart nginx
I don't really know what to do. I wonder if the updated file is not pointing to the right address anymore maybe.
Thanks,
Lucien
My domain is: 4968431.xyz
I ran this command: sudo certbot --nginx
It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Which names would you like to activate HTTPS for?
We recommend selecting either all domains, or all domains in a VirtualHost/server block.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: 4968431.xyz
2: www.4968431.xyz
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
Requesting a certificate for 4968431.xyz and www.4968431.xyz
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/4968431.xyz/fullchain.pem
Key is saved at: /etc/letsencrypt/live/4968431.xyz/privkey.pem
This certificate expires on 2024-01-19.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for 4968431.xyz to /etc/nginx/sites-enabled/default
Successfully deployed certificate for www.4968431.xyz to /etc/nginx/sites-enabled/default
Congratulations! You have successfully enabled HTTPS on https://4968431.xyz and https://www.4968431.xyz
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
My web server is (include version): nginx/1.18.0 (Ubuntu)
The operating system my web server runs on is (include version): Ubuntu 22.04.3 LTS
My hosting provider, if applicable, is:
I can login to a root shell on my machine (yes or no, or I don't know): yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel): no
The version of my client is (e.g. output of certbot --version
or certbot-auto --version
if you're using Certbot): certbot 2.7.2