Haproxy + Ssl With Yii

Hello my friends,

i have a website developed with yii.

deployed the website in amazon , using opsworks ( machines go up and down due to load )

website running in SSL.

current status :

1 load balancer - haproxy.

1 running machine with application php ( yii ) + 9 will start on load.

1 memcache server

once i have a little load, i encounter the following:

  1. client arrives , haproxy redirect to SERVER_1

  2. SERVER_1 generate assets folder called 2dr3e45f4

  3. client receives html with the following <script src="/assets/2dr3e45f4/jquery.js" />

  4. client arrives , haproxy redirect to SERVER_2

  5. SERVER_2 has no "2dr3e45f4" folder under assets sends error 500.

  • because of the SSL i cant do sticky session.

any ideas how can i deploy my application ? and solve this assets issue ?

first solution:

  1. create custom assetsManager

  2. creation of the "2dr3e45f4" changed to static "public" and not a hash function

  3. all instances now will serve <script src="/assets/public/jquery.js" />

  4. pushed "public" folder into git.