From 74f00bba0fb8bc746d7ca03fd45de4e3dc0d2d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mauritz=20Hardersen=20Skog=C3=B8y?= Date: Tue, 4 Mar 2025 11:57:40 +0100 Subject: [PATCH] Fix again --- nginx.conf | 31 ++++++++++++++++++++++++ nginx/nginx.conf | 62 +++++++++++++++++------------------------------- 2 files changed, 53 insertions(+), 40 deletions(-) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..158a736 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,31 @@ +server { + listen 80; + + location / { + proxy_pass http://0.0.0.0:23/; + proxy_set_header Host ; + proxy_set_header X-Real-IP ; + proxy_set_header X-Forwarded-For ; + } +} + +server { + listen 217; + location / { + proxy_pass http://0.0.0.0:21/; + proxy_set_header Host ; + proxy_set_header X-Real-IP ; + proxy_set_header X-Forwarded-For ; + } +} + + +server { + listen 227; + location / { + proxy_pass http://0.0.0.0:22/; + proxy_set_header Host ; + proxy_set_header X-Real-IP ; + proxy_set_header X-Forwarded-For ; + } +} diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 131034d..f4c9a36 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,49 +1,31 @@ -user nginx; -worker_processes 1; -error_log /var/log/nginx/error.log warn; -pid /var/run/nginx.pid; - - -events { - worker_connections 1024; -} - -http { - server { +server { listen 80; - # Route to frontend location / { - proxy_pass http://frontend:3000; - proxy_set_header Host $http_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_pass http://0.0.0.0:23/; + proxy_set_header Host ; + proxy_set_header X-Real-IP ; + proxy_set_header X-Forwarded-For ; } +} - # Route to backend - location /api/ { - proxy_pass http://backend:8000; - proxy_set_header Host $http_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; +server { + listen 217; + location / { + proxy_pass http://0.0.0.0:/; + proxy_set_header Host ; + proxy_set_header X-Real-IP ; + proxy_set_header X-Forwarded-For ; } +} - location /admin/ { - proxy_pass http://backend:8000; - proxy_set_header Host $http_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; - } - location /static/admin/ { - proxy_pass http://backend:8000; - proxy_set_header Host $http_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; +server { + listen 227; + location / { + proxy_pass http://0.0.0.0:22/; + proxy_set_header Host ; + proxy_set_header X-Real-IP ; + proxy_set_header X-Forwarded-For ; } - } -} \ No newline at end of file +}