From 7c0f7d9bea9df81e15dd70247c03bee7fb57891a Mon Sep 17 00:00:00 2001 From: abdulhade Date: Mon, 7 Apr 2025 12:55:42 +0300 Subject: [PATCH] Added help to configure Nginx. --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index 6ce0261..caaef21 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ This repository includes: - [Using the `test_setup` command:](#using-the-test_setup-command) - [Run it and make it available to use](#run-it-and-make-it-available-to-use) - [Create your first admin user](#create-your-first-admin-user) + - [Expose the API](#expose-the-api) ## Getting Started @@ -247,6 +248,60 @@ Enter role (admin/user): admin You don't need passwords for this, just the username and role. + +### Expose the API + +This app currently runs on your local network only, we need to expose it so the data consumer on the Data Analysis product can access it and consume the data it provides. + +2. Create the config file: + + `/etc/nginx/sites-available/your_domain_com.conf` + +```bash + +server { + + server_name "your_domain.com"; # Replace with your domain + + listen 80; + listen [::]:80; + client_max_body_size 10G; + + proxy_connect_timeout 7d; + proxy_send_timeout 7d; + proxy_read_timeout 7d; + send_timeout 7d; + keepalive_timeout 7d; + + proxy_buffer_size 128k; + proxy_buffers 4 256k; + proxy_busy_buffers_size 256k; + + proxy_set_header Accept-Encoding ""; + + location / { + proxy_pass http://localhost:8080; # Replace with the port you set [default 8080]. + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } +} +``` + +1. Enable the Config + + +```bash + +sudo ln -s /etc/nginx/sites-available/your_domain_com.conf /etc/nginx/sites-enabled/ +sudo nginx -t # Test config +sudo systemctl restart nginx + +``` + ---