Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to add "resolver" directive to Reverse proxy settings #2064

Open
2 tasks done
gutleib opened this issue Mar 5, 2025 · 3 comments
Open
2 tasks done

[BUG] Unable to add "resolver" directive to Reverse proxy settings #2064

gutleib opened this issue Mar 5, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@gutleib
Copy link

gutleib commented Mar 5, 2025

What happened?

I have installed Bunkerweb 1.6.0 (BTW -- thank you for great software!) and is testing it right now.
We are running a Nomad+Consul on several hosts for fault-tolerance. Service discovery uses Consul dynamical DNS resolving for routing traffic.
To do so, we need to use "resolver" directive of Nginx. As I understand, additional settings go to " Reverse proxy includes" field in Reverse proxy plugin page in UI. But when I enter something like `"resolver 10.5.0.1 valid=5s;", field blocks saving and applying.
Now maybe I'm using it wrong, but this seems to be intuitive place for it.

How to reproduce?

Try to input a line of Nginx config in "Reverse proxy includes" field on "Reverse proxy - v1.0" page of Bunkerweb 1.6.0

Configuration file(s) (yaml or .env)

IS_DRAFT=no
SERVER_NAME=beta.example.com
USE_TEMPLATE=low
BAD_BEHAVIOR_THRESHOLD=30
BAD_BEHAVIOR_BAN_TIME=360
USE_CORS=yes
CORS_ALLOW_ORIGIN=*
USE_DNSBL=no
KEEP_UPSTREAM_HEADERS=*
CONTENT_SECURITY_POLICY=
REFERRER_POLICY=no-referrer-when-downgrade
PERMISSIONS_POLICY=
COOKIE_FLAGS=* SameSite=Lax
AUTO_LETS_ENCRYPT=yes
EMAIL_LETS_ENCRYPT=admin@example.com
LIMIT_CONN_MAX_HTTP1=25
LIMIT_CONN_MAX_HTTP2=200
LIMIT_CONN_MAX_HTTP3=200
LIMIT_REQ_RATE=5r/s
ALLOWED_METHODS=GET|POST|HEAD|OPTIONS|PUT|DELETE|PATCH
MAX_CLIENT_SIZE=8000m
USE_REVERSE_PROXY=yes
REVERSE_PROXY_HOST=http://example-site-frontend.service.consul:1506
REVERSE_PROXY_WS=yes
*REVERSE_PROXY_INCLUDES=*
REVERSE_PROXY_HOST_1=http://example-site-backend.service.consul:8108
REVERSE_PROXY_URL_1=/api/
REVERSE_PROXY_BUFFERING_1=no
REVERSE_PROXY_HOST_2=http://example-site-frontend.service.consul:1506/authorization
REVERSE_PROXY_URL_2=/authorization/
REVERSE_PROXY_BUFFERING_2=no
REDIRECT_HTTP_TO_HTTPS=yes

Relevant log output

BunkerWeb version

1.6.0

What integration are you using?

Docker

Linux distribution (if applicable)

Ubuntu

Removed private data

  • I have removed all private data from the configuration file and the logs

Code of Conduct

  • I agree to follow this project's Code of Conduct
@gutleib gutleib added the bug Something isn't working label Mar 5, 2025
@TheophileDiot
Copy link
Member

Hi @gutleib,

Thank you for opening this issue! The REVERSE_PROXY_INCLUDES directive is specifically designed for configurations that require the include prefix. For your use case, you'll need to create a custom configuration to achieve the desired setup.

https://docs.bunkerweb.io/testing/advanced/#custom-configurations

@gutleib
Copy link
Author

gutleib commented Mar 10, 2025

Thank you!
Will "/configs/global/http" section be appended to every service, of am I understanding documentation wrong?

I'm trying to add resolver 10.5.0.1 valid=5s; to it, but getting "config wrong, rolling back". Or is such option make all gui-configuring impossible, and "custom config" needs to be complete nginx config altogether?

@TheophileDiot
Copy link
Member

Hi @gutleib, that's because we already have a setting that sets it: DNS_RESOLVERS. Also when you're having a configuration issue BunkerWeb logs should tell you what happened when the test is done (we test the config before executing a reload so your server is still up and running).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants