str
doesn't work for your path because it is designed to match/parse a constant string. str
works well for the constant "Location "
but you need to provide a parser for the path part too. You don't specify what that might be so here is an example that just parses any characters.
let path = manyChars anyChar
let pLocation = str "Location " >>. path
test pLocation "Location /root/somepath"
You might want to a different parser for the path, for example this parses any characters until a newline or end of file so that you could parse many lines.
let path = many1CharsTill anyChar (skipNewline <|> eof)
You could make other parsers that don't accept spaces or handle quoted paths, etc.