Enclose paths in an nginx rewrite rule in quotes to escape spaces
The redirect producer should escape spaces in paths used in an nginx rewrite rule by enclosing the values in quotes rather than escaping the spaces with a backslash. Instead of:
location = /foo/bar/path\ with\ spaces.html { return 301 /foo/baz/path\ with\ spaces.html; }
it should be:
location = '/foo/bar/path with spaces.html' { return 301 '/foo/baz/path with spaces.html'; }
Although escaping the space with a blackslash allows nginx to start cleanly, the rule itself does not work. nginx returns a 505 error (HTTP version not supported) when the rule is triggered.
Edited by Dan Allen