From edd696320ecf29afaac618dc8e85ec4090fed205 Mon Sep 17 00:00:00 2001 From: alexeh Date: Thu, 5 Sep 2024 10:12:40 +0200 Subject: [PATCH] add ebs conf files to infra --- .../.ebextensions/authorized_keys.config | 17 ++++++++ .../proxy/conf.d/application.conf | 43 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 infrastructure/source_bundle/.ebextensions/authorized_keys.config create mode 100644 infrastructure/source_bundle/proxy/conf.d/application.conf diff --git a/infrastructure/source_bundle/.ebextensions/authorized_keys.config b/infrastructure/source_bundle/.ebextensions/authorized_keys.config new file mode 100644 index 0000000..d8be91e --- /dev/null +++ b/infrastructure/source_bundle/.ebextensions/authorized_keys.config @@ -0,0 +1,17 @@ +files: + /home/ec2-user/.ssh/extra_authorized_keys: + mode: "000400" + owner: ec2-user + group: ec2-user + content: | + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxeHqNG3GJhm+KC9tpAKht18HPlvvLxQfBm6NbH+c6Y10qH7DbtT/FXTLZpzlIeSJaG3bS/8FKOHEIuLh07UcMskLPXLR6kijcrK9A3ZA/mBwfuNFk0u+s+ZSVRuCyy2kHPhouUMfdm289b5yOSkCXW+uVKM0pT3eFhGd7IvFTDxVazLrmdAVfHktsXw+Ohc32EiW5ITI7EZ4Xg+CNypIqRf3EGlRF17A2azn5dz08AwkYIBqTy+EHSMSdU5WSotarhGMNKsVplgpgpyXxeOphPHcntjb7fiu0KTBviAelmXilNTv/HA1qjYFuSFNv3sUNQiUQzaV3T2PSOUyLXbBFy0A7pXsX2gGvTafyE8WJsu/6kkOY9iqnkcZhYYHEemWpw6oPzc3mx9Z+AO57j4nG7TlPxpY9/Ydk6NS5oj4u5djYcpQvd7ztJMuAft7I32TwXrY5E/ywzoMQsPMoMiLzjZq+B27e5dN4vQ2iJwkS629GN9vgVRe2SSG0gtObyesfUJBNFWsaZBLFYqjiCAU+DMFRR48wUVai6oOz0qWxYQxqlrEA45aRvHy3Jz2JiMzlWAaiVOWHyFXkJQlGyObPL0U0Blf8y2NWhwicejz+LH9BWA5zdtuyHZD39Fll/10j64mim5reRhO1r7FvQIiK+KtSXSMeMdV1xVyJZPYWIw== alex@Alexs-MacBook-Pro.local +commands: + 01_touch_keys_file: + cwd: /home/ec2-user/.ssh/ + command: touch authorized_keys + 02_append_keys: + cwd: /home/ec2-user/.ssh/ + command: sort -u extra_authorized_keys authorized_keys -o authorized_keys + 99_rm_extra_keys: + cwd: /home/ec2-user/.ssh/ + command: rm extra_authorized_keys diff --git a/infrastructure/source_bundle/proxy/conf.d/application.conf b/infrastructure/source_bundle/proxy/conf.d/application.conf new file mode 100644 index 0000000..702b5ce --- /dev/null +++ b/infrastructure/source_bundle/proxy/conf.d/application.conf @@ -0,0 +1,43 @@ +upstream api { + server api:4000; +} + +upstream client { + server client:3000; +} + +server { + listen 80; + + location / { + proxy_pass http://client; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + } + + location /api/ { + rewrite ^/api/?(.*)$ /$1 break; + proxy_pass http://api; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass_request_headers on; + client_max_body_size 200m; + } +} + + +