buttressed ansible playbook for automatic ssl certification
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Disco DeDisco
2026-03-03 14:18:21 -05:00
parent 06f85d4c54
commit 105b8f1e34
2 changed files with 11 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
[staging] [staging]
staging.earthmanrpg.me ansible_user=discoman ansible_ssh_private_key_file=~/.ssh/id_ed25519_wsl_python-tdd staging.earthmanrpg.me ansible_user=discoman ansible_ssh_private_key_file=~/.ssh/id_ed25519_wsl_python-tdd letsencrypt_domain=staging.earthmanrpg.me
[production] [production]
www.earthmanrpg.me ansible_user=discoman ansible_ssh_private_key_file=~/.ssh/id_ed25519_wsl_python-tdd www.earthmanrpg.me ansible_user=discoman ansible_ssh_private_key_file=~/.ssh/id_ed25519_wsl_python-tdd

View File

@@ -1,6 +1,15 @@
server { server {
listen 80; listen 80;
server_name {{ django_allowed_host | replace(',', ' ')}}; server_name {{ django_allowed_host | replace(',', ' ')}};
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name {{ django_allowed_host | replace(',', ' ') }};
ssl_certificate /etc/letsencrypt/live/{{ letsencrypt_domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ letsencrypt_domain }}/privkey.pem;
location /static/ { location /static/ {
alias /var/www/gamearray/static/; alias /var/www/gamearray/static/;
@@ -11,6 +20,6 @@ server {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto https;
} }
} }