mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-01 15:55:49 +03:00
allow use of assets server without any provider
This commit is contained in:
@@ -88,6 +88,8 @@ By default no request log generated. This can be turned on by setting `--logger.
|
||||
|
||||
User may turn assets server on (off by default) to serve static files. As long as `--assets.location` set it will treat every non-proxied request under `assets.root` as a request for static files.
|
||||
|
||||
Assets server can be used without any proxy providers. In this mode reproxy acts as a simple web server for a static context.
|
||||
|
||||
## More options
|
||||
|
||||
- `--gzip` enables gizp compression for responses.
|
||||
|
||||
@@ -164,7 +164,7 @@ func makeProviders() ([]discovery.Provider, error) {
|
||||
res = append(res, &provider.Static{Rules: opts.Static.Rules})
|
||||
}
|
||||
|
||||
if len(res) == 0 {
|
||||
if len(res) == 0 && opts.Assets.Location == "" {
|
||||
return nil, errors.Errorf("no providers enabled")
|
||||
}
|
||||
return res, nil
|
||||
|
||||
@@ -5,6 +5,11 @@ run: install
|
||||
../../dist/reproxy --file.enabled --file.name=reproxy.yml --assets.location=./web --assets.root=/static
|
||||
pkill -9 whoami
|
||||
|
||||
run_assets_only: install
|
||||
../../dist/reproxy --assets.location=./web --assets.root=/
|
||||
|
||||
pkill -9 whoami
|
||||
|
||||
kill:
|
||||
pkill -9 whoami
|
||||
|
||||
|
||||
Reference in New Issue
Block a user