Is nginx? Rewrite server {set $ host_pathdatasitewww.ttlsa.com; slave; server_namettlsa.comwww.ttlsa.com; root $ host_pathhtdocs; set $ yii_bootstrapindex.php; # definecharset
Is nginx? Yii rewrite server {set $ host_path "/data/site/www.ttlsa.com"; access_log/data/logs/nginx/www.ttlsa.com _ access. log main; server_name ttlsa.com www.ttlsa.com; root $ host_path/htdocs; set $ yii_bootstrap "index. php "; # define charset
Is nginx? Rewrite of yii
Server {set $ host_path "/data/site/www.ttlsa.com"; access_log/data/logs/nginx/www.ttlsa.com _ access. log main; server_name ttlsa.com www.ttlsa.com; root $ host_path/htdocs; set $ yii_bootstrap "index. php "; # define charset UTF-8; location/{index index.html $ yii_bootstrap; try_files $ uri // $ yii_bootstrap? $ Args;} # deny access to protected directories location ~ ^/(Protected | framework | themes/w +/views) {deny all;} # avoid processing of callto unexisting static files by yii location ~. (Js | css | png | jpg | gif | swf | ico | pdf | mov | fla | zip | rar) $ {try_files $ uri = 404 ;} # prevent nginx from serving dotfiles (. htaccess ,. svn ,. git, etc .) location ~ /. {Deny all; access_log off; log_not_found off;} # php-fpm configuration using socket location ~. Php {fastcgi_split_path_info ^ (. +. php )(. *) $; # yii catches the callto unexising PHP files set $ fsn/$ yii_bootstrap; if (-f $ document_root $ fastcgi_script_name) {set $ fsn $ fastcgi_script_name;} fastcgi_pass unix: /tmp/php5-fpm.sock ;#? Change to your FastCGI include fastcgi_params; fastcgi_param SCRIPT_FILENAME $ document_root $ fsn; # PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies them for CGI fastcgi_param PATH_INFO $ response; fastcgi_param PATH_TRANSLATED $ document_root $ fsn; # Tweak fastcgi buffers, just in case. fastcgi_buffer_size 128 k; fastcgi_buffers 256 4 k; fastcgi_busy_buffers_size 256 k; fastcgi_temp_file_write_size 256 k ;}}
Original article address: yii nginx rewrite rules. Thank you for sharing them.