diff --git a/docs/Server-Setup.md b/docs/Server-Setup.md new file mode 100644 index 0000000..a9d9221 --- /dev/null +++ b/docs/Server-Setup.md @@ -0,0 +1,20 @@ +### Setup of https://btc-explorer.com on Ubuntu 16.04 + + apt update + apt upgrade + apt install git python-software-properties + curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - + npm install pm2 --global + apt install nginx + add-apt-repository ppa:certbot/certbot + apt update + apt upgrade + apt install python-certbot-nginx + +Copy content from [./btc-explorer.com.conf](./btc-explorer.com.conf) into `/etc/nginx/sites-available/btc-explorer.com.conf` + + certbot --nginx -d btc-explorer.com + cd /etc/ssl/certs + openssl dhparam -out dhparam.pem 4096 + cd /home/bitcoin/btc-rpc-explorer + pm2 start bin/www --name "btc-rpc-explorer" diff --git a/docs/btc-explorer.com.conf b/docs/btc-explorer.com.conf new file mode 100644 index 0000000..66f1277 --- /dev/null +++ b/docs/btc-explorer.com.conf @@ -0,0 +1,32 @@ +## http://domain.com redirects to https://domain.com +server { + server_name btc-explorer.com; + listen 80; + #listen [::]:80 ipv6only=on; + + location / { + return 301 https://btc-explorer.com$request_uri; + } +} + +## Serves httpS://domain.com +server { + server_name btc-explorer.com; + listen 443 ssl http2; + #listen [::]:443 ssl http2 ipv6only=on; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; + ssl_prefer_server_ciphers on; + ssl_session_cache shared:SSL:10m; + ssl_dhparam /etc/ssl/certs/dhparam.pem; + + location / { + proxy_pass http://localhost:3002; + 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; + } +}