server {
listen 8084;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main;
root "D:/phpStudy/WWW"; location / {
index index.html index.htm index.php l.php;
rewrite ^/views/(.*\.(css|js|jpg|gif|png))$ /views/$1 last;
rewrite ^/(.*)$ /index.php/$1 last;
autoindex off;
} #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root "D:/phpStudy/WWW";
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
location ~* .(jpg|gif|png|js|css)$ {
root D:/phpStudy/WWW/boosens;
if (-f $request_filename) {
expires max;
break;
}
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

  附apache:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

  

nginx配置之取消index.php同时不影响js,css功能的更多相关文章

  1. nginx设置反向代理后,页面上的js css文件无法加载

    问题现象: nginx配置反向代理后,网页可以正常访问,但是页面上的js css文件无法加载,页面样式乱了. (1)nginx配置如下: (2)域名访问:js css文件无法加载: (3)IP访问:j ...

  2. Apache和Nginx配置默认访问index.php

    Apache: .htaccess文件配置 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d R ...

  3. Nginx配置PATHINFO隐藏index.php

    1.网络来源:http://www.shouce.ren/post/view/id/1529 server {      listen       80;     default_type text/ ...

  4. 【Nginx】Nginx配置REWRITE隐藏index.php

    只需要在server里面加上 if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; }

  5. Nginx配置REWRITE隐藏index.php

    server { listen 80; server_name localhost; root D:\workspace\PHP\Atromic; location / { index index.p ...

  6. nginx配置ssl证书后无法访问https

    一直听说https更安全,要安装证书,一直没试过,今天终于试了试 首先得有个http的域名网站,服务器. 到阿里云的安全-ssl证书管理申请一个免费的,可以绑定一个域名  然后完善资料,照着例子配置一 ...

  7. nginx配置 首页不显示 index.html首页是显示域名

    原状况如下: 访问:www.test.com 敲回车后浏览器中自动跳转致: www.test.com/index.html 公司新需求如下: 访问:www.test.com 敲回车后浏览器中url不变 ...

  8. nginx配置默认首页(index.htnl index.htm)全流程(包含遇到问题的解决)

    需求: 自己有个域名,原来直接扔在了服务器的文件夹里(根据客服人员指导),自己玩了一遍nginx的安装部署等操作之后,域名的指向发生了改变,到了nginx成功的界面. 自己抱着极大的好奇心来配置ngi ...

  9. nginx配置隐藏index.php

    Nginx 服务器隐藏 index.php 配置   location / { try_files $uri $uri/ /index.php?$query_string; }   nginx配置中t ...

随机推荐

  1. xml引用实体dtd不能成功的问题

    你没有错,现在的浏览器都不怎么支持实体引用了,这是个无奈的现实.我记得上回试过,好像如果DTD不是单独的文件而是内置到XML里面的话,实体还可以显示的.你可以试一下 <?xml version= ...

  2. 【数据采集】VBA数据采集可用 COM 组件

    windows 中提供了4个COM组件都可以进行数据采集. Wininet WinHttp XmlHttp MSHTML https://msdn.microsoft.com/en-us/librar ...

  3. 15. 3Sum_左右开工,遍历找出符合目标的数字

    题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find al ...

  4. [Android Pro] ScrollView嵌套RecyclerView时滑动出现的卡顿

    reference to : http://zhanglu0574.blog.163.com/blog/static/113651073201641853532259/ ScrollView嵌套Rec ...

  5. js未定义判断

    if (typeof(homeType) == 'undefined') { //..... //..... } typeof函数判断,如果未定义的就会返回undefined,注意undefined ...

  6. Arch Linux 安装博通 BCM4360 驱动(Arch Linux, Ubuntu, Debian, Fedora...)

    BCM4360 在2010年9月,博通完全开源的硬件驱动[1].该驱动程序 brcm80211已被列入到自2.6.37之后的内核中.随着2.6.39发布,这些驱动程序已被重新命名为 brcmsmac和 ...

  7. [LeetCode] Remove Linked List Elements

    Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --& ...

  8. 详解ABP框架的多租户

    (此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:ABP框架对多租户场景提供了很好的支持,内建了多租户的处理机制,今天我们来深入解析一下 ...

  9. xamarin.Android 标记1

    群里一个朋友的博客 推荐一下 自己也做个书签记录. http://sunyt.me/2015/04/15/Xamarin-FAQ/

  10. 【转】Java Web 项目获取运行时路径 classpath

    Java Web 项目获取运行时路径 classpath 假设资源文件放在maven工程的 src/main/resources 资源文件夹下,源码文件放在 src/main/java/下, 那么ja ...