From c36ea0287e69c7aadf46b6c7dc273edaa56e81c5 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Thu, 11 Jul 2024 14:29:35 -0300 Subject: [PATCH] Cleanup, fix header for caddy backend --- provision-pinky/hosts | 15 ++++++++++++--- provision-pinky/server.yml | 12 +++++++++++- provision-pinky/setup_user.yml | 3 ++- reverse_proxy/nginx.conf | 21 ++++----------------- 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/provision-pinky/hosts b/provision-pinky/hosts index 53fb850..c3bfdac 100644 --- a/provision-pinky/hosts +++ b/provision-pinky/hosts @@ -1,7 +1,16 @@ [servers] -pinky ansible_user=ralsina -rocky ansible_user=ralsina +pinky +rocky -[servers:vars] +[faas] +lawn + +[interactive] +pinky +rocky +lawn + +[all:vars] +ansible_user=ralsina ansible_connection=ssh ansible_python_interpreter=/usr/bin/python3 \ No newline at end of file diff --git a/provision-pinky/server.yml b/provision-pinky/server.yml index 8cea491..f59c7d0 100644 --- a/provision-pinky/server.yml +++ b/provision-pinky/server.yml @@ -10,6 +10,16 @@ - docker - docker-compose - btrfs-progs + - qemu-system-arm + - qemu-utils + state: present + - name: Install Debian-specific packages + become: true + when: ansible_os_family == 'Debian' + ansible.builtin.apt: + name: + - qemu-efi-aarch64 + - net-tools state: present - name: Start and enable service docker become: true @@ -41,4 +51,4 @@ ansible.builtin.service: name: docker state: restarted - \ No newline at end of file + diff --git a/provision-pinky/setup_user.yml b/provision-pinky/setup_user.yml index 4953bd5..222b886 100644 --- a/provision-pinky/setup_user.yml +++ b/provision-pinky/setup_user.yml @@ -1,6 +1,6 @@ # Setup my user with some QoL packages and settings - name: Basic Setup - hosts: servers + hosts: interactive become_method: ansible.builtin.sudo tasks: - name: Install some packages @@ -22,6 +22,7 @@ name: - ncurses-term state: present + update_cache: true - name: Add the user ralsina become: true ansible.builtin.user: diff --git a/reverse_proxy/nginx.conf b/reverse_proxy/nginx.conf index 82f589c..6799d0b 100644 --- a/reverse_proxy/nginx.conf +++ b/reverse_proxy/nginx.conf @@ -7,6 +7,7 @@ server { location / { proxy_pass http://pinky.ralsina.github.beta.tailscale.net:8080; proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header Host $host; } error_page 500 502 503 504 /custom_50x.html; location = /custom_50x.html { @@ -24,6 +25,7 @@ server { location / { proxy_pass http://pinky.ralsina.github.beta.tailscale.net:8086; proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header Host $host; } error_page 500 502 503 504 /custom_50x.html; location = /custom_50x.html { @@ -41,6 +43,7 @@ server { location / { proxy_pass http://pinky.ralsina.github.beta.tailscale.net:3000; proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header Host $host; } error_page 403 404 500 502 503 504 /custom_50x.html; location = /custom_50x.html { @@ -67,6 +70,7 @@ server { location / { proxy_pass http://pinky.ralsina.github.beta.tailscale.net:7777; proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header Host $host; } location /stream { @@ -127,23 +131,6 @@ server { } } -server { - listen 8080; - listen [::]:8080; - - server_name social.ralsina.me; - - location / { - proxy_pass http://pinky.ralsina.github.beta.tailscale.net:3003; - proxy_set_header X-Forwarded-Host $http_host; - - # WebSocket support - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - } -} - server { listen 8080; listen [::]:8080;