Nginx 配置二级虚拟目录访问 Laravel 重写
server {
listen 80;
server_name _;
root /opt/sites;
index index.php index.html index.htm;
etag on;
gzip on;
gzip_vary on;
gzip_http_version 1.0;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 2;
gzip_disable msie6;
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/xml+rss;
client_max_body_size 110m;
client_body_buffer_size 1024k;
keepalive_timeout 60;
sendfile on;
sendfile_max_chunk 512k;
tcp_nopush on;
tcp_nodelay on;
# 此处配置二级目录站点
location /son{
alias /opt/sites/cms/public;
index index.html index.php;
try_files $uri $uri/ /index.php?$query_string;
location ~ \.php$ {
if (!-f $request_filename) {
return 404;
}
fastcgi_pass unix:/tmp/php-fpm-72.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
#此处是根目录下配置laravel站点
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/tmp/php-fpm-72.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = /robots.txt { access_log off; log_not_found off; }
location = /favicon.ico { access_log off; log_not_found off; }
}
这次遇到的问题是在访问http://localhost/son
访问不了index.php,而index.html可以访问。在参考了https://laravel-china.org/articles/14235/nginx-configuring-two-level-virtual-directory-access-laravel-rewrite
解决.
Nginx 配置二级虚拟目录访问 Laravel 重写的更多相关文章
- 安装Alertmanager,nginx配置二级路径代理访问
安装配置 Alertmanager wget https://github.com/prometheus/alertmanager/releases/download/v0.20.0/alertman ...
- LAMP虚拟主机配置以及控制目录访问
3.基于域名的虚拟主机配置 NameVirtualHost192.168.3.32:80#apache2.2.xx版本需要开启此选项,而且要和下面的保持一致:2.4.x版本就不需要此项设置了 < ...
- php 配置主机虚拟目录(使用虚拟域名访问 127.0.0.1) 一点也不好使?????
php 配置主机虚拟目录(使用虚拟域名访问 127.0.0.1)steps:1>打开目录 D:\xwamp\bin\apache\apache2.4.9\conf 修改文件 httpd ...
- 使用nginx配置二级域名
使用nginx配置二级域名 2018.11.21 11:51:17字数 613阅读 170 最近想把三个项目配在一个服务器上,于是想使用nginx配置二级域名实现. 1.域名添加解析 我的是阿里云的域 ...
- Windows下Nginx配置SSL实现Https访问(包含证书生成)
Vincent.李 Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...
- 关于使用ssm与spring时,配置tomcat 虚拟目录( doBase )中的一些坑
一.使用SSM需要 配置虚拟目录时 tomcat的配置 在tomcat server.xml的<HOST></HOST>中加入以下内容 在配置完成之后,当我们访问URL 为 ...
- Nginx反向代理的目录访问问题
Nginx反向代理的目录访问问题 2013-05-13 23:21 2730人阅读 评论(0) 收藏 举报 从昨天就开始纠结了,在做实验的时候,遇到目录访问的问题,如下 前端nginx vhost的设 ...
- JSP配置了虚拟目录使用JavaBean报错
今天遇到一个很棘手的问题,在jsp文件中使用useBean,网页返回码出现了500服务器内部错误,报错信息如下: The value for the useBean class attribute w ...
- 解决nginx发布网站跨目录访问
解决nginx发布网站跨目录访问(thinkphp5+lnmp) 到:usr/local/nginx/conf/vim fastcgi.cof 把最后一行加上井号#注释掉保存重启 restart 参考 ...
随机推荐
- vue-项目模块化中this 指向问题
在VUE项目中,我们想把一些主要的代码抽到一个模块中 export default { /** * 获取本地的群列表数据 * @param {*} params */ getGroupList () ...
- 解决IDEA Initialization error 'https://start.spring.io'
IDEA Initialization error 'https://start.spring.io' 弹出一个error窗口 就是不能连接https://start.spring.i ...
- vue学习-day01(vue指令)
目录: 1.什么是vue.js 2.为什么要学习前端的流行框架 3.框架和库的区别 4.后端MVC和前端的MVVM的区别 5.vue.js的基本代码--hollo world代 ...
- 使用Swagger自动生成文档
1.maven依赖 maven仓库(https://mvnrepository.com/)搜索springfox <!-- https://mvnrepository.com/artifact/ ...
- 2019 Multi-University Training Contest 3 T6 - Fansblog
Fansblog Time Limit: 2000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submi ...
- 【bzoj1026】[SCOI2009]windy数
*题目描述: windy定义了一种windy数.不含前导零且相邻两个数字之差至少为2的正整数被称为windy数. windy想知道,在A和B之间,包括A和B,总共有多少个windy数? *输入: 包含 ...
- python调用Opencv库和dlib库
python是一门胶水语言,可以调用C++编译好的dll库 python调用opencv-imggui.dll文件 https://www.cnblogs.com/zhangxian/articles ...
- 人脸三维建模A Morphable Model For The Synthesis Of 3D Faces(三维人脸合成的变形模型)
Abstract摘要 In this paper, a new technique for modeling textured 3D faces is introduced. 3D faces can ...
- 在windows窗口下打开文件夹
System.Diagnostics.Process.Start("Explorer.exe", @"C:\Users\gnt-wangt\Documents\Visua ...
- 使用node.js搭建本地服务器
第一步安装node:https://nodejs.org/zh-cn/download/ 接下来就需要安装http的镜像文件 打开cmd:输入以下命令 npm install http-server ...