nginx配置之取消index.php同时不影响js,css功能
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功能的更多相关文章
- nginx设置反向代理后,页面上的js css文件无法加载
问题现象: nginx配置反向代理后,网页可以正常访问,但是页面上的js css文件无法加载,页面样式乱了. (1)nginx配置如下: (2)域名访问:js css文件无法加载: (3)IP访问:j ...
- Apache和Nginx配置默认访问index.php
Apache: .htaccess文件配置 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d R ...
- Nginx配置PATHINFO隐藏index.php
1.网络来源:http://www.shouce.ren/post/view/id/1529 server { listen 80; default_type text/ ...
- 【Nginx】Nginx配置REWRITE隐藏index.php
只需要在server里面加上 if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; }
- Nginx配置REWRITE隐藏index.php
server { listen 80; server_name localhost; root D:\workspace\PHP\Atromic; location / { index index.p ...
- nginx配置ssl证书后无法访问https
一直听说https更安全,要安装证书,一直没试过,今天终于试了试 首先得有个http的域名网站,服务器. 到阿里云的安全-ssl证书管理申请一个免费的,可以绑定一个域名 然后完善资料,照着例子配置一 ...
- nginx配置 首页不显示 index.html首页是显示域名
原状况如下: 访问:www.test.com 敲回车后浏览器中自动跳转致: www.test.com/index.html 公司新需求如下: 访问:www.test.com 敲回车后浏览器中url不变 ...
- nginx配置默认首页(index.htnl index.htm)全流程(包含遇到问题的解决)
需求: 自己有个域名,原来直接扔在了服务器的文件夹里(根据客服人员指导),自己玩了一遍nginx的安装部署等操作之后,域名的指向发生了改变,到了nginx成功的界面. 自己抱着极大的好奇心来配置ngi ...
- nginx配置隐藏index.php
Nginx 服务器隐藏 index.php 配置 location / { try_files $uri $uri/ /index.php?$query_string; } nginx配置中t ...
随机推荐
- Spark集群部署
Spark是通用的基于内存计算的大数据框架,可以和hadoop生态系统很好的兼容,以下来部署Spark集群 集群环境:3节点 Master:bigdata1 Slaves:bigdata2,bigda ...
- sql 列转行
原表:转过的表: 代码: ) set @sql = 'select AssetRecordId ' select @sql = @sql + ' , max(case ExtendName when ...
- HTML是什么?如何使用?
①我们首先打开桌面DW网页开发器. 也可以是其他的开发器. ②打开之后那么我们创建一个新的文档: 点击创建之后出现下图: 一般我们不管用哪种网页开发器,都会最先呈现上图的状态,那么下面来解读一下这些文 ...
- PAT A 1018. Public Bike Management (30)【最短路径】
https://www.patest.cn/contests/pat-a-practise/1018 先用Dijkstra算出最短路,然后二分答案来验证,顺便求出剩余最小,然后再从终点dfs回去求出路 ...
- github之git基本命令介绍的简单整理
git 格式: git [--version] [--exec-path[=<path>]] [--html-path] [--info-path] [-p|--paginate|--no ...
- Chart图表
这东西挺直观 封装个类 public class aaa { private string name; public string Name { get { return name; } set { ...
- 中间人攻击(MITM)姿势总结
相关学习资料 http://www.cnblogs.com/LittleHann/p/3733469.html http://www.cnblogs.com/LittleHann/p/3738141. ...
- ACM: SCU 4440 Rectangle - 暴力
SCU 4440 Rectangle Time Limit:0MS Memory Limit:0KB 64bit IO Format:%lld & %llu Practic ...
- ios 单例设计模式
单例模式的意思就是只有一个实例.单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例.这个类称为单例类.单例可用性非常高,用于登录用户管理等可供全局调用. + (AccountMa ...
- win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
今天想在在win7 64位环境下使用python 操作mysql 在安装MySQL-python 时报错: _mysql.c _mysql.c(42) : fatal error C1083: Can ...