mirror of
https://github.com/umputun/reproxy.git
synced 2024-09-11 08:55:25 +03:00
allow use of assets server without any provider
This commit is contained in:
parent
39ca5e966f
commit
be20b0b636
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user