diff options
| author | crupest <crupest@outlook.com> | 2024-11-11 01:12:29 +0800 | 
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2024-12-19 21:42:01 +0800 | 
| commit | f9aa02ec1a4c24e80a206857d4f68198bb027bb4 (patch) | |
| tree | 5994f0a62733b13f9f330e3515260ae20dc4a0bd /template2/nginx/server.ts | |
| parent | 7b4d49e4bbdff6ddf1f8f7e937130e700024d5e9 (diff) | |
| download | crupest-f9aa02ec1a4c24e80a206857d4f68198bb027bb4.tar.gz crupest-f9aa02ec1a4c24e80a206857d4f68198bb027bb4.tar.bz2 crupest-f9aa02ec1a4c24e80a206857d4f68198bb027bb4.zip | |
HALF WORK: 2024.12.19
Re-organize file structure.
Diffstat (limited to 'template2/nginx/server.ts')
| -rw-r--r-- | template2/nginx/server.ts | 66 | 
1 files changed, 0 insertions, 66 deletions
| diff --git a/template2/nginx/server.ts b/template2/nginx/server.ts deleted file mode 100644 index ffd64b7..0000000 --- a/template2/nginx/server.ts +++ /dev/null @@ -1,66 +0,0 @@ -// Used to generate json schema. - -// path should start with "/", end without "/" and contain no special characters in regex. -// the special case is root path "/", which is allowed. - -// For example: -// Given -//   path: /a/b -//   to: http://c.com/d -// Then (no_strip_prefix is false) -//   url: /a/b/c -//   redirect to: http://c.com/d/c (/a/b is removed) -// Note: -// Contrary to reverse proxy, you would always want to strip the prefix path. -// Because there is no meaning to redirect to the new page with the original path. -// If you want a domain-only redirect, just specify the path as "/". -export interface RedirectService { -  type: "redirect"; -  path: string; // must be a path, should start with "/", end without "/" -  to: string; // must be a url, should start with scheme (http:// or https://), end without "/" -  code?: number; // default to 307 -} - -// For example: -// Given -//   path: /a/b -//   root: /e/f -// Then (no_strip_prefix is false) -//   url: /a/b/c/d -//   file path: /e/f/c/d (/a/b is removed) -// Or (no_strip_prefix is true) -//   url: /a/b/c/d -//   file path: /e/f/a/b/c/d -export interface StaticFileService { -  type: "static-file"; -  path: string; // must be a path, should start with "/", end without "/" -  root: string; // must be a path (directory), should start with "/", end without "/" -  no_strip_prefix?: boolean; // default to false. If true, the path prefix is not removed from the url when finding the file. -} - -// For example: -// Given -//   path: /a/b -//   upstream: another-server:1234 -// Then -//   url: /a/b/c/d -//   proxy to: another-server:1234/a/b/c/d -// Note: -//   Contrary to redirect, you would always want to keep the prefix path. -//   Because the upstream server will mess up the path handling if the prefix is not kept. -export interface ReverseProxyService { -  type: "reverse-proxy"; -  path: string; // must be a path, should start with "/", end without "/" -  upstream: string; // should be a [host]:[port], like "localhost:1234" -} - -export type Service = RedirectService | StaticFileService | ReverseProxyService; - -export interface SubDomain { -  name: string; // @ for root domain -  services: Service[]; -} - -export interface Server { -  domains: SubDomain[]; -} | 
