I am just looking for a little assistance in setting up my Nginx conf file. My site is digibrain.co and I currently have it running on http with these settings:
upstream backend {
server backend:8000;
}
server {
listen 80;
server_name digibrain.co;
location /.well-known/acme-challenge/ {
root "/var/www/certbot";
}
location / {
root "/var/www/frontend";
try_files $uri $uri/ /index.html;
}
location /api/ {
proxy_pass http://backend;
proxy_set_header Host $http_host;
}
location /admin/ {
proxy_pass http://backend;
proxy_set_header Host $http_host;
}
location /static/ {
alias /backend/static/;
}
}
I am thinking that I should be adding something like this but I am not sure:
server {
listen 443 ssl;
server_name digibrain.co;
location / {
proxy_pass http://digibrain.co;
}
ssl_certificate /etc/letsencrypt/live/digibrain.co/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/digibrain.co/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
I already have certs on the server and the system is using docker-compose (not that it should matter).
All help is appreciated. Thanks!