Skip to content

Instantly share code, notes, and snippets.

@malkitsingh
Last active April 14, 2019 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malkitsingh/9aecc1b2c2ebce6158547cfcd47d156c to your computer and use it in GitHub Desktop.
Save malkitsingh/9aecc1b2c2ebce6158547cfcd47d156c to your computer and use it in GitHub Desktop.
Setting Node.JS on Ubuntu
**Install Node.js**
cd ~
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
sudo apt-get install build-essential
**Install Nginx**
sudo apt-get update
sudo apt-get install nginx
**Adjust the Firewall**
sudo ufw app list -- to list all available apps
Nginx Full: This profile opens both port 80 (normal, unencrypted web traffic) and port 443 (TLS/SSL encrypted traffic)
Nginx HTTP: This profile opens only port 80 (normal, unencrypted web traffic)
Nginx HTTPS: This profile opens only port 443 (TLS/SSL encrypted traffic)
sudo ufw allow 'Nginx Full'
**Manage the Nginx Process**
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
**Set Up Nginx as a Reverse Proxy Server**
sudo nano /etc/nginx/sites-available/default
. . .
location / {
proxy_pass http://localhost:8080;
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;
}
}
**Check Nginx syntax**
sudo nginx -t
sudo systemctl restart nginx
@malkitsingh
Copy link
Author

Detect web traffic source device

http://detectmobilebrowsers.com/mobile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment