Added help to configure Nginx.

This commit is contained in:
2025-04-07 12:55:42 +03:00
parent d4c5037606
commit 7c0f7d9bea

View File

@@ -31,6 +31,7 @@ This repository includes:
- [Using the `test_setup` command:](#using-the-test_setup-command) - [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) - [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) - [Create your first admin user](#create-your-first-admin-user)
- [Expose the API](#expose-the-api)
## Getting Started ## Getting Started
@@ -247,6 +248,60 @@ Enter role (admin/user): admin
You don't need passwords for this, just the username and role. 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
```
--- ---