server-setup.md
February 25, 2024 ยท View on GitHub
Nginx setup (optional)
Install Nginx
sudo apt install nginx
Start Nginx
systemctl start nginx
Configuration
Generate a file called labml_app.conf within the /etc/nginx/sites-available directory, and include the following
content.
server {
listen 80;
listen <port>;
server_name <server-ip>;
location / {
proxy_pass http://127.0.0.1:<port>;
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;
}
}
Enable the file by creating a link to it within the sites-enabled directory.
sudo ln -s /etc/nginx/sites-available/labml_app.conf /etc/nginx/sites-enabled/
Restart the Nginx service.
sudo systemctl restart nginx
You can
follow this guide
to configure Nginx to use Gzip for data compression.