Skip to content

Simple reverse proxy server. Useful for accessing web applications on various servers (or VMs) through a single domain.

License

Notifications You must be signed in to change notification settings

foxsir/reverseproxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

reverseproxy

version license

Simple reverse proxy server. Useful for accessing web applications on various servers (or VMs) through a single domain.

How it works?

Just complete the conf.json file and run the server. Example:

 {
     "ip":"",
     "port":"8080",
     "routes":{
	     "/upload":"192.168.88.160:8080",
 	     "/Downloads/":"192.168.88.164:8000",
 	     "#":"the pattern / matches all paths not matched by other registered patterns",
 	     "/":"192.168.88.161"
     }
 }

Configuration details

 "ip":"",

No ip mean localhost on hosting server. Is no need to change this.

 "port":"8080",

The server listening on this port. Remeber to forward the port 80 to this port if your connection pass through a router. No root right are required if you run on big ports (eg. 8080).

Routes

Routes has the folowing structure

 "path":"target"

The path is what you request and the target is what you get (eg. if your domain is example.com then / mean example.com/ and /upload mean example.com/upload).

# path mean a comment and is not added to routes. Put the text in target. #something don't mean a comment.

The reverse proxy add your path to the target, so be prepared to handle this path. For example the folowing will get an error page.

 "/upload":"google.com"

Use / path for main site which have index page on /. Use sufixes for other web services which have the sufix as main page.

Remeber that a route like /name/ mean match any starting with name (eg. /api/ match also /api/bla and so on).

Do not repeat the routes because the server will take always tha last route to a target.

About

Simple reverse proxy server. Useful for accessing web applications on various servers (or VMs) through a single domain.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%