1. Christoffer Niska
  2. yii-img
  3. Issues
Issue #5 new

NGINX Rewrite Rules

this_is_ari NA
created an issue

Out of the box the image module doesn't seem to support the NGINX web server, which doesn't use htaccess files. Therefore something like the following needs to be added to your NGINX config in order for the module to work

set $host_path "/home/user/yii-root-directory"; location ~ ^/files/(.*).(gif|jpg|jpeg|png)$ { alias $host_path$request_uri; if (-f $request_filename) { expires 30d; break; } }

Comments (3)

  1. Log in to comment