Skip to content

caldwmark/next-reverse-proxied

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-reverse-proxied

my boilerplate for a quick and easy docker container with ssl and cache

features

  • ssl-proxy - for taking the headaches out of certbot
  • nginx - for caching the apps responses !speed! !speed! !speed!
  • node - this example uses a next.js app. it could be any framework

usage

clone this repo into your projects short name. in this example I use bcp as my short name
git clone https://github.com/caldwmark/next-reverse-proxied.git bcp

move into the empty app folder and clone or copy your project into it. Be sure to replace bcp with your own project short name.
cd bcp/next/app
git clone <my blog code> .

containers

the idea here is ssl-proxy answers the call on port 443. it handles the certificates and ssl then passes the requests to nginx.

nginx here is acting as a reverse caching proxy. It catches the request on and looks for it in cache and fetches it from the next app if it's not cached

browser requests => ssl-proxy => nginx => next

nginx

rename the bearcountry.conf to something more appropriate for your site. this is the server section of the nginx.conf edit it to your unique needs.

check the nginx.conf also. edit it if needed.

next

next could be python, or whatever... if you rename the next container name in docker-config.yml. make sure to also catch the proxy pass redirect in the yoursite.conf of nginx to reflect the new name:port

ssl-proxy

ssl-proxy is a binany generated from go code. it's a handy little tool for handling ssl. more info on it's usage can be found on its github page.

startup

once you are satisfied with your settings, you can start it by going back into the project folder. the one holding docker-compose.yml and entering the following command
docker compose up -d --build

to see if they all started
docker ps
should show the three containers

view the logs
docker compose logs

Releases

No releases published

Packages

No packages published