Skip to content

abbychau/slashing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slashing

This is a HTTPS server, which aims to replace my personal nginx usages.

Currently, it serves Reverse Proxying (e.g. to a Python-Flask,Java,PHP-Swoole,etc. server) , Static File Serving , Let's Encrypt with multiple hosts support. It also does proxy load-balancing in robin-round manner

Update: It is now: Reverse Proxy + Static File Server + Let's Encrypt + multiple hosts + Redis-Compatible-KV + SQLite Server in ONE process.

Usage

  1. Edit config.txt

Explanation:

#reverse proxy targets
backend=127.0.0.1:9527
backend=127.0.0.1:9528
backend=127.0.0.1:9529
backend=127.0.0.1:9530
#... you can add as many as you want
#redis port and address
redis=127.0.0.1:10060
#sqlite port and address
rdbms=127.0.0.1:10061
#domain and paths to serve static files
#domain=leveling.m2np.com:/home/wwwroot/leveling.m2np.com
#domain=level.m2np.com:/root/level

  1. Start the server with the file name of the config.
./slashing config.txt

You should see logs similar to:

2021/07/08 21:13:59 Start slashing...
2021/07/08 21:13:59 Certificate cache directory is : cache-golang-autocert-root 
2021/07/08 21:13:59 Starting HTTP->HTTPS redirector and HTTPS server...
  1. The first time a domain is visited, it will undergo Let's encrypt challange and the autocerts will be stored under the directory you started slashing.

Why it is called slashing

Because it slashed NGINX, Redis, MySQL(although it is a sqlite behind). And AutoCert is so comfortable!

Development Note

About

Reverse Proxy + Static File Server + Let's Encrypt + multiple hosts + Redis-Compatible-KV + SQLite Server in ONE process.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages