Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serving polymer bundles based on user-agent using Nginx

Tags:

nginx

polymer

What is the possible way for serving Polymer bundles based on user agent?

  1. ES-5 bundled (For IE only)
  2. ES-6 bundled (For Chrome & Firefox)

I am using NGINX web server and here is my Nginx config file partial code.

map $http_user_agent $version {
    ~(MSIE|Edge|Trident) es5;
    default es6;
}

location /cdn {
    proxy_pass  http://my_appname/$version;
}

Unfortunately, it does not seems to work. if someone has one any alternate solution please share.

like image 323
Junaid Akhtar Avatar asked Mar 27 '26 13:03

Junaid Akhtar


1 Answers

i suggest you use PRPL Server which is doing exactly that. It will deliver es5 or es6 to your client depending on it´s capabilities.

like image 174
Pascal L. Avatar answered Mar 30 '26 03:03

Pascal L.