Skip to content

Instantly share code, notes, and snippets.

@wizardnet972
Created January 11, 2018 14:44
Show Gist options
  • Save wizardnet972/eb958ee7c1d2d5a59830ed9c94e841af to your computer and use it in GitHub Desktop.
Save wizardnet972/eb958ee7c1d2d5a59830ed9c94e841af to your computer and use it in GitHub Desktop.
install nginx on aws ubuntu (by wizardnet972)
(by wizardnet972)
sudo wget http://nginx.org/keys/nginx_signing.key
sudo apt-key add nginx_signing.key
cd /etc/apt
sudo nano sources.list
> appending this text at the end:
deb http://nginx.org/packages/ubuntu xenial nginx
deb-src http://nginx.org/packages/ubuntu xenial nginx
sudo apt-get update
sudo apt-get install nginx
sudo service nginx start
>Continue to Opening Your Web Page.
cd /etc/nginx/conf.d
sudo mv default.conf default.conf.bak
sudo nano server.conf
copy this to the file save & close:
server {
server_name shlomi-levi.net www.shlomi-levi.net;
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;
}
listen 80;
}
sudo npm i pm2 -g
cd
git clone
pm2 start ./index.js
sudo nginx -s reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment