Skip to content

Commit

Permalink
Merge pull request #215 from mendix/DEP-913
Browse files Browse the repository at this point in the history
Intercept proxy errors for specific paths
  • Loading branch information
svanderburg authored Nov 14, 2018
2 parents c98934a + 24b9ea5 commit b9e361d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/nginx.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def get_path_config():
expires 1y;
}
proxy_pass http://mendix;
proxy_intercept_errors %s;
satisfy %s;
%s
%s
Expand All @@ -51,6 +52,7 @@ def get_path_config():
}
proxy_pass http://mendix;
}
proxy_intercept_errors %s;
satisfy %s;
%s
%s
Expand All @@ -68,6 +70,20 @@ def get_path_config():
raise Exception(
"Can not override access restrictions on system path %s" % path
)
if path in [
"/",
"/p/",
"/rest-doc/",
"/link/",
"/api-doc/",
"/odata-doc/",
"/ws-doc/",
"/rest-doc",
]:
proxy_intercept_errors = "on"
else:
proxy_intercept_errors = "off"

satisfy = "any"
if "satisfy" in config:
if config["satisfy"] in ["any", "all"]:
Expand Down Expand Up @@ -100,6 +116,7 @@ def get_path_config():
indent = "\n" + " " * (0 if path == "/" else 4)
result += template % (
path,
proxy_intercept_errors,
satisfy,
indent.join(ipfilter),
client_cert,
Expand Down

0 comments on commit b9e361d

Please sign in to comment.