首页 > 代码库 > CI框架下nginx重写规则
CI框架下nginx重写规则
因为:
server { listen 80; server_name 222.73.130.124; location / { index index.html index.htm index.php; root /data0/htdocs/www; if (!-e $request_filename) { rewrite "^/(.*)$" /index.php last;//这一条很重要 } rewrite ^/$/index.php last; } location ~ .*\.(php|php5)?$ { root /data0/htdocs/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info;//这一条很重要 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fcgi.conf; } log_format wwwlogs ‘$remote_addr - $remote_user [$time_local] "$request" ‘ ‘$status $body_bytes_sent "$http_referer" ‘ ‘"$http_user_agent" $http_x_forwarded_for‘; access_log /data1/logs/wwwlogs.log wwwlogs; }
完成。
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。