❄️Configure Frontend
After installing Nginx, create the Frontend reverse-proxy configuration file using the command:
nano /etc/nginx/sites-available/app.com.conf
Paste the configuration code below and change the IP to your machine's IP.
server {
server_name 0.0.0.0; #YourIP, example: 144.87.33.65
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;
}
}
Ctrl + X and type Y hit Enter to save config file.
Link the file to nginx enabled section.
ln -s /etc/nginx/sites-available/app.com.conf /etc/nginx/sites-enabled/app.com.conf
Test if ok.
nginx -t
If you see long OK message done correctly. Else please do the steps correctly.
Restart nginx
service nginx restart
Last updated