Skip to content

Instantly share code, notes, and snippets.

View feelchi1star's full-sized avatar
😃
I am very Happy Today

Felix Chinonso Emmanuel feelchi1star

😃
I am very Happy Today
View GitHub Profile
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
#ONE FOR EACH NEXTJS APP AND SUBDOMAIN
#BIKES - PORT 3001
@feelchi1star
feelchi1star / proxy-deployment-ubuntu-18.04-tutorial.md
Created December 26, 2022 11:46 — forked from InathiM/proxy-deployment-ubuntu-18.04-tutorial.md
A complete walkthrough on setting up hosting for a web app and a deployment pipeline.

This is a complete walkthrough on setting up hosting for a web app and a deployment pipeline. Some things can be imporoved, but this can be used as well.

Our app is monolithic JS app: React frontend, Express backend, managed by yarn. PM2 process manager. Database is out of scope currently, but some notes will be added later. We use nginx as reverse proxy. We will set up SSL via "Let's Encrypt" for free.

All this is hosted on DigitalOcean (that can also be changed). In DigitalOcean's terms, we will setup two droplets (i.e. two machines) that will be used for staging and production. We also added a space (object storage) that is used to store large files (this is out of scope and doesn't change any portion of this setup).

We will use Github and Github Actions to hook into events that happen within our code repository.

The flow is as follows: once this setup is complete, our repo will have activated actions. On each push to the dev branch - newest version of that branch will be pulled and transfered into a

@feelchi1star
feelchi1star / cors.nginxconf
Created November 18, 2022 11:38 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
#server side:
#server live directory: /var/www/domain.com
#server repository: /var/repo/site.git
1. clone project from git/bitbucket into /var/www/domain.com or init the folder by "git init".
2. go to /var/repo/site.git and init the folder as git bare
$git init --bare
--bare means that our folder will have no source files, just the version control.