All Guides
Nginx Web Server Setup
Install Nginx web server and configure it as a reverse proxy.
Intermediate20 min
Setup Steps
1. Install Nginx:
sudo apt update
sudo apt install nginx -y2. Start Nginx:
sudo systemctl start nginx
sudo systemctl enable nginx3. Create a server block:
sudo nano /etc/nginx/sites-available/mysite4. Configuration content:
server {
listen 80;
server_name mysite.com www.mysite.com;
root /var/www/mysite;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}5. Enable the site:
sudo ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx6. Reverse proxy for Node.js app:
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}7. Enable gzip compression:
gzip on;
gzip_types text/css application/javascript application/json;Related Guides
Linux VPS Server Setup (Ubuntu)
Configure your Ubuntu-based VPS server from scratch. Security, user management and basic settings.
Apache Web Server Setup
Install Apache HTTP server and configure virtual hosts.
Let's Encrypt SSL Certificate Setup
Get a free SSL/TLS certificate with Certbot and enable HTTPS.
Node.js and npm Setup
Install Node.js runtime and npm package manager.