Could you please suggest some practical nginx configuration relying on $http_user_agent to rewrite/proxy differently in these scenarios:
- All modern client browsers - I would render all html on the client side in this case.
- Old client browsers. I know it's difficult to decide what is old...
- Search engines robots to serve them a simplified static content.
- Web apps to serve static simplified content to (e.g., pinterest - all that read pages so that I can exclude design pictures from those pages leaving only main content pictures).
- User agents that are better to be blocked (although it is arguable whether it is better to have your web app put to a test by a hacker who forgot to fake user_agent or by a more experienced one who didn't).
Extra :) Should I also give a special content to the sites that use open-graph meta tags (such as facebook/linkedin/etc.)? It often seems that I have more of those tags than the rest of my html? In this case I would also like to recognise them via $http_user_agent, but I'll just use it in page-header template not to include OG-partial.
PS If you can suggest good regex patterns or some other way to achieve user-agent matching, without nginx configs, please answer anyway...