From a6417334445a08c9b76a8f9f12e9993422314be8 Mon Sep 17 00:00:00 2001 From: ekzyis Date: Tue, 7 Nov 2023 09:08:56 +0100 Subject: [PATCH] Add dev nginx config --- nginx.dev.conf | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 nginx.dev.conf diff --git a/nginx.dev.conf b/nginx.dev.conf new file mode 100644 index 0000000..eac60de --- /dev/null +++ b/nginx.dev.conf @@ -0,0 +1,56 @@ +upstream delphi-dev-backend { + server 127.0.0.1:4322; +} + +upstream delphi-dev-frontend { + server 127.0.0.1:4323; +} + +map $http_upgrade $connection_upgrade { + default upgrade; + '' close; +} + +server { + server_name dev1.delphi.market; + listen 80; + listen [::]:80; + + return 301 https://dev1.delphi.market$request_uri; +} + +server { + server_name dev1.delphi.market; + listen 443; + listen [::]:443; + + ssl on; + ssl_certificate /etc/letsencrypt/live/dev1.delphi.market/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev1.delphi.market/privkey.pem; + + location / { + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Prefix /; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + proxy_pass http://delphi-dev-frontend$request_uri; + } + + location /api { + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Prefix /; + proxy_pass http://delphi-dev-backend$request_uri; + } + + location /hotreload { + root /var/www/dev1.delphi; + } + + include letsencrypt.conf; +}