Ubuntu Varnish mobile detection results in to page not found?

霸气de小男生 提交于 2019-12-12 02:28:15

问题


I am trying this example to do mobile device detection using varnish https://github.com/varnish/varnish-devicedetect/blob/master/INSTALL.rst

I implemented Example 1 and now trying to test it via the testing tools at the bottom https://github.com/varnish/varnish-devicedetect/blob/master/INSTALL.rst#testing-tools

I am unsure how to work this part, it gives me Page not Found

Now you can access it through:

http://localhost:5911/devicetest/ , or
http://localhost:6081/devicetest/ # Change 6081 into your Varnish listening port.

For the backend example I am using port no 5912, which I updated in the devicedetect-dev.vcl file and backend/example-backend.py file.

When I do mywebsiteaddress:5912/set_ua_device/ , I get a Page not found error. I am unsure what I am missing in this case?

I also tried Example 3 install and it works fine for me. Although I would prefer to enable the device detection via Example 1. I am trying this on ubuntu AWS server.

Update: After restarting both the apache and varnish. I can now achieve step1 of testing-tools and a cookie is being set. Although mywebsiteaddress:5912/set_ua_device/ still results in a 404 Page not found

Not sure what I am missing here. Thanks.


回答1:


for people coming on this page searching how to serve for different devices using varnish . other than varnish-devicedetect you can also try a different solution .

try this tutorial from atomic object

they follow a very simple approach and all you need to do is add few vcl rules, suited for noobs like me



来源:https://stackoverflow.com/questions/23482395/ubuntu-varnish-mobile-detection-results-in-to-page-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!