Comments (3)
Workaround
Use regex replace to set the request path without turning it into an empty string:
actions:
req_path:
- replace:
from_regex: /mypath/?(.*)
to_regsub: /\1
from orm.
Available workaround
Below does not work in this case as the problem is that the path rewrite leaves an empty string. See below comment for a working req_path
action.
Use a separate exact match to handle the problematic case explicitly:
from orm.
The root cause for the behaviour in this specific case is a rule on the form:
- description: A VCL_Error generating rule
domains:
- example.com
matches:
all:
- paths:
begins_with:
- "/path"
actions:
backend:
origin: https://some.domain.example.com
req_path:
- prefix:
remove: '/path'
A request to https://example.com/path
makes the variable path
in Varnish to ""
and later there will be a set req.url = variable.get("path");
which is not allowed because it triggers
-- VCL_Error Setting req.url to empty string
So to fix this there needs to be some check for the empty string in the path
variable. Something like
if (variable.get("path") != "") {
set req.url = variable.get("path");
} else {
set req.url = "/";
}
from orm.
Related Issues (20)
- Debug-headers in ORM
- HAProxy verify certificate on health check HOT 1
- Validate config/cache paths
- Add collision check for query string matches HOT 1
- Do not test for pypy3.5 or python3.5
- Configurable origin health checks HOT 1
- Example rules: More, more detailed, and perhaps structured differently HOT 4
- Release 1.1.2 HOT 2
- Match on header HOT 6
- Match on HTTP method HOT 1
- Collision check cache metadata is not updated
- Document HTTP method matching feature HOT 2
- Tidy up ORM schema for v2 HOT 1
- Document synthetic_response action
- Document timeouts HOT 2
- Document supported versions of HAProxy and Varnish
- Documentation for section 'tests' is missing in the syntax reference
- Build pipeline broken HOT 6
- Time for a new release?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orm.