nginx配置多目录访问
操作系统:ubuntu13.10
服务器:nginx 1.6
在nginx配置根据url指向不同访问不同的目录
使用location /目录名 { ... } 可以做到不同的目录访问
但是我想搭建laravel4 framework,想通过/coolwifi/test就直接解析成/coolwifi/public/index.php/test,但是会报错:
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
但是通过http://localhost/coolwifi/public/index.php/test访问是可以的
我该怎么做?
default配置文件如下:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /home/kimhwawoon/nginx;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location /coolwifi/ {
index index.php;
#if (!-e $request_filename) {
# rewrite ^/(.*)$ /public/index.php?$1 last;
# break;
#}
try_files $uri $uri/ /coolwifi/public/index.php?$args;
}
location /phpmyadmin/ {
index index.php
try_files $uri $uri/ /phpmyadmin/index.php?$args;
}
location /swagger/ {
index index.html index.php;
}
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
相关阅读:
node-webkit调用本地库执行文件操作会造成主程序卡住,阻塞,怎么才能开启多个进程来处理文件操作呢
在safari上报错,chrome和firefox正常显示数据图像。。求解
python爬虫多线程假死怎么解决?
nginx 正则,如何匹配不以/结尾且不以.xml .html .htm结尾
jquery截取当前页面
當 crossdomain.xml 超過20k, xmlsocket 連線失敗
vue+vue-router+vuex+vue-resource项目 刷新页面的问题
eclipse 启动虚拟机的时候屏幕闪动问题
Bluepoint 实现二级域名
maven库中没有依赖包,如何解决
Chrome Dev Tools 里的 Computed Style 通过 javascript 如何实现
时间轴插件 实现无限循环
网站响应比较慢,如何排除?
用PhpStorm开发Thinkphp项目,如何显示引用的css文件中的元素提示?
mac系统下用带YouCompleteMe插件的vim编写cpp程序报错
Python里怎么实现do while?
a标签的点击问题
求助,C语言初学者遇到一题不会
thinkphp 中的图片路径该如何保存?
reactjs完全代替jquery使用好不好?