Skip to content

Instantly share code, notes, and snippets.

@hoanglannet
Forked from wizardnet972/nginx-aws
Created May 26, 2018 09:35
Show Gist options
  • Save hoanglannet/1157f4b90f07acd20f7cc6a083b87309 to your computer and use it in GitHub Desktop.
Save hoanglannet/1157f4b90f07acd20f7cc6a083b87309 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