nginx 下使用laravel 需要配置.conf文件,否则无法访问指定路由(不知道说路由是否合适,刚学的小白,tp中对应的应该方法)
2018-01-14 17:22
991 查看
server {
listen 82;
server_name location;
set $root_path '/vagrant/laravel/public';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
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 PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}
listen 82;
server_name location;
set $root_path '/vagrant/laravel/public';
root $root_path;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location ~ \.php {
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 PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
}
相关文章推荐
- nginx 下使用laravel 需要配置.conf文件,否则无法访问指定路由(不知道说路由是否合适,刚学的小白,tp中对应的应该方法)
- 【网页访问单向、双向验证均可以】https原理及tomcat配置https方法[生成CA根证书配置tomcat后,若要成功访问axis中的webservice,需要配置它对应的axis2.xml文件]
- 普元 ESB 6.6,在开发的中介流中需要使用queryByNamedSql方法,这个方法对应的namedSql文件应该放在什么位置下?
- Image.FromFile方法会锁住文件的解决方法(文件正由另一进程使用,因此该进程无法访问该文件)
- nginx&apache中禁止指定文件或目录访问的方法
- 用流的方法解决“文件正由另一进程使用,因此该进程无法访问该文件” 的问题 FileStream
- “另一个程序正在使用此文件,进程无法访问”的解决方法
- 多线程写文件异常(正由另一进程使用,因此该进程无法访问该文件)的解决方法
- 使用SSH在做插入和修改的时候即使数据库中给字段设置了默认值还是没有用,在表对应的配置文件中也不知道该如何配置。。请教下。。
- 关于IIS服务启动失败的问题:“IIS提示‘另一个程序正在使用此文件,进程无法访问’”,的解决方法
- Nginx无法正确解析PHP文件,配置文件方法
- windows下使用IIS配置的PHP无法上传文件的解决方法
- windows 2003 Windows无法访问指定设备路径或文件,您可能没有合适的权限访问这个项目
- C#中文件正由另一进程使用,因此该进程无法访问该文件解决方法
- Windows无法访问指定设备路径或文件,您可能没有合适的权限访问这个项目
- 完美解决“windows 无法访问指定设备、路径或文件。你可能没有合适的权限访问这个项目”
- 安装VS2005 SP1出现这样问题“windows 无法访问指定设备、路径或文件。您可能没有合适的权限访问这个项目。”
- [转] "计算机无法访问,您可能没有权限使用网络资源.请与这台服务器的管理员联系以查明您是否有访问权限" 解决方法
- Windows无法访问指定设备路径或文件,您可能没有合适的权限访问这个项目
- windows2003 IIS 服务启动失败,提示‘另一个程序正在使用此文件,进程无法访问',解决方法