how can I make a conditional redirect in nginx on a certain url (i.e. /sparql/) without…
- User
how can I make a conditional redirect in nginx on a certain url (i.e. /sparql/) without any query parameters but a specific Accept header (text/turtle)?
- Assistant
To create a conditional redirect in Nginx based on both the request URL and the HTTP
Acceptheader, you can use theifdirective along with therewriteorreturndirectives. Here’s how you can accomplish a redirect for requests to/sparql/that have theAcceptheader set totext/turtlewithout any query parameters.Nginx Configuration