Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user
The exchange of new line & br HTML tag could refer to PHP - nl2br() function, which uses to inserts HTML line breaks before all newlines in a string.
These JavaScript functions consider whether to use insert or replace to handle the swap.
/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉
- Generate your SSH keys as per your git provider documentation.
- Add each public SSH keys to your git providers acounts.
- In your
~/.ssh/config, set each ssh key for each repository as in this exemple:
| # Author: Zameer Ansari | |
| # You should look at the following URL's in order to grasp a solid understanding | |
| # of Nginx configuration files in order to fully unleash the power of Nginx. | |
| # http://wiki.nginx.org/Pitfalls | |
| # http://wiki.nginx.org/QuickStart | |
| # http://wiki.nginx.org/Configuration | |
| # | |
| # Generally, you will want to move this file somewhere, and start with a clean | |
| # file but keep this around for reference. Or just disable in sites-enabled. | |
| # |
Next.js, Nginx with Reverse proxy, SSL certificate
- UPDATE (07/20/2021):
- This process got simplified over the years of this gist being out
- Older version of this gist (without certbot): https://gist.github.com/kocisov/2a9567eb51b83dfef48efce02ef3ab06/33fdd88872a0801bdde58fccce430fa48737ae10
- I would also now recommend deploying to Vercel if you don't need custom server support
| { | |
| "name": "sikofitt/guzzle-example", | |
| "description": "Guzzle Example", | |
| "type": "project", | |
| "require": { | |
| "php":">=5.6", | |
| "guzzlehttp/guzzle": "^6.2" | |
| }, | |
| "require-dev": { | |
| "symfony/var-dumper": "^3.2", |
| <?php | |
| /* | |
| * Using a key => value pair with the yield keyword is | |
| * the cleanest method I could find to add identifiers or tags | |
| * to asynchronous concurrent requests in Guzzle, | |
| * so you can identify which response is from which request! | |
| */ | |
| $client = new GuzzleHttp\Client(['base_uri' => 'http://httpbin.org']); |
It is loaded by default by /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist.
If you run
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis