I am trying to use Wurfl plugin for Nginx. I am using Openresty instead of Vanilla Nginx. I don't get correct User-Agent set in the User-Agent header. So I am trying to set the User-Agent header myself while I process the request. But I feel that Wurfl has already resolved the User-Agent present as part of header when the request hit the server. Is there a way to set the User-Agent value through the code and resolve the device capabilities on the newly set header.
2 Answers
Luca Passani, ScientiaMobile CTO here. The WURFL Module for NGINX is a commercial product and as such all customers get direct support from our awesome support team. I suggest you contact ScientiaMobile directly and we will be more than happy to assist. Is there some reason why you are not comfortable using the standard support channels? Anyway if you post your configuration file here, I'll ask someone from the team to look into this thread. The fact that you cannot see the user-agent string is an indication that something is wrong (is it possible that you are looking at an HTTP request that has already been mangled with upstream?)
Here is an example of configuration from the documentation posted on our website:
WURFL Module NGINX Configuration
Thanks

- 1,021
- 8
- 20
-
Additionally to verify which user-agent wurfl is working on you will have to enable : wurfl_request_property wurfl_engine_target; and (if you are using fastcgi) : fastcgi_param WURFL_ORIGINAL_USERAGENT $wurfl_useragent; to receive a custom header (named WURFL_ORIGINAL_USERAGENT) containing the useragent that wurfl has read. – Luca P. Aug 24 '16 at 12:54
Something that you might want to try is the 51Degrees Nginx module, the User-Agent remains unaffected when the detection is carried out, and the capabilities are set in a header of your choice. As it does not touch the User-Agent header other than to read it, you should be able to change it as much as you like.
Also, does it need to be changed before the detection? If not then the proxy_set_header will be fine. But if it needs to be set before you will have to use the set function (which I'm not certain can be used to set existing header).
Alternatively, if this is just for testing, then the Modify Headers addon for Firefox is very good for this, or even Apache Bench.

- 36
- 3
-
I had to downvote this. The question is about a ScientiaMobile product. Jumping on this to plug a competitor's product is not very professional and does not reflect good light on the company that does it. Also it is not OK to hide one's affiliation. – Luca P. Aug 24 '16 at 11:40