Yii2 nginx配置伪静态
Yii2 配置 Nginx 伪静态
主要检查以下代码:
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php?$args;
}
完整代码:

server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6
server_name mysite.local;
root /path/to/basic/web;
index index.php;
access_log /path/to/basic/log/access.log;
error_log /path/to/basic/log/error.log;
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php?$args;
}
# uncomment to avoid processing of calls to non-existing static files by Yii
#location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
# try_files $uri =404;
#}
#error_page 404 /404.html;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
try_files $uri =404;
}
location ~ /\.(ht|svn|git) {
deny all;
}
}
Yii2 nginx配置伪静态的更多相关文章
- nginx配置伪静态
最近做门户网站,使用了的nginx重写规则 项目目录下写好 nginx.conf文件 然后在打开nginx配置文件,在server引入对应的重写规则的文件就可以了 当然直接写在配置里面 locatio ...
- Nginx配置-伪静态,隐藏index.php大入口
server { listen ; server_name ; root E:/www/wvtuan/; index index.php index.html; log_not_found off; ...
- 记一次nginx配置伪静态规则
server { listen 80; server_name sss.cn; root "root/"; location / { index index.html index. ...
- Nginx 服务器伪静态配置不当造成 Access denied
Nginx 服务器伪静态配置不当造成 Access denied 有群有反馈将 FastAdmin 布署到阿里云后无法打开后台. 出现如下提示,首页是可以打开,点登录链接后出现的.(下是群友的截图) ...
- 【转】 nginx rewrite 伪静态配置参数详细说明
nginx rewrite 伪静态配置参数和使用例子 附正则使用说明 正则表达式匹配,其中: * ~ 为区分大小写匹配 * ~* 为不区分大小写匹配 * !~和!~*分别为区分大小写不匹配及不区分 ...
- thinkphp nginx 配置
thinkphp convention配置:'URL_MODEL' => '2', //URL模式 nginx rewrite配置: if (!-e $request_filename) { r ...
- nginx1.9.4 +php 5.5.29+yii2.0配置手册
nginx1.9.4 +php 5.5.29+yii2.0配置手册 目录 一. php5.5.29安装配置 2 二. nginx1.9.4安装配置 2 三. yii2.0 ...
- Nginx的使用(二)Nginx配置wordpress
安装php:https://windows.php.net/download/,php默认启动命令:php-cgi.exe -b 127.0.0.1:9000 安装wordpress:https:// ...
- tp5中nginx配置
首先tp5的访问目录指向到webroot/public文件夹中. thinkphp的url访问:http://serverName/index.php(或者其它应用入口文件)/模块/控制器/操作/[参 ...
随机推荐
- sqlserver binary varbinary image 的区别
sqlserver binary varbinary image 的区别 binary 固定长度的二进制数据,其最大长度为 8,000 个字节. varbinary 可变长度的二进制数 ...
- 转:Spring AOP中的动态代理
原文链接:Spring AOP中的动态代理 0 前言 1 动态代理 1.1 JDK动态代理 1.2 CGLIB动态代理 1.2.1 CGLIB的代理用法 1.2.2 CGLIB的过滤功能 2 S ...
- es6原型的继承
class Parent { name = 'liangcheng'; } const parent = new Parent(); console.log(parent); // 类继承某实例对象属 ...
- 王者荣耀里拿个王者有啥了不起,有胆就来挑战一下ApsaraCache源码
王者荣耀大家估计都玩的很溜吧,撸完代码开一局,只要不遇到个猪队友,拿个鲁班后羿估计你们都能爆掉对手的塔吧.大神们打个排位赛拿个王者就和吃饭夹菜一样简单... But...你们玩过Redis和Memca ...
- awk 和 sed (Stream Editor)
1.sed pattern space(模式空间)相当于车间sed把流内容在这里处理: hold space(保留空间)相当于仓库,加工的半成品在这里临时储存(当然加工完的成品也在这里存储). h/H ...
- 使用shell脚本监控用户登陆服务器并发送提示信息给微信
1.需要在/etc/ssh/目录下面创建一个名为sshrc的文件,执行权限可给可不给,那么在有人通过ssh远程登录这台服务器的时候,这段脚本就会被执行 #!/bin/bash ###V1---### ...
- Jmeter测试实践:文件上传接口
1.打开jmeter4.0,新建测试计划,添加线程组.根据实际情况配置线程属性. 2.添加HTTP请求. Basic部分修改如下: Advanced部分我做任何修改,完全保持默认.但是有人说Imple ...
- Visual Studio Code的常用快捷键
一.Visual Studio Code简介 Visual Studio Code是个牛逼的编辑器,启动非常快,完全可以用来代替其他文本文件编辑工具.又可以用来做开发,支持各种语言,相比其他IDE,轻 ...
- Java中输出正则表达式匹配到的内容
import java.util.regex.Matcher; import java.util.regex.Pattern; public class A { public static void ...
- python安装pandas模块
直接安装时报错了 localhost:~ ligaijiang$ pip3 install pandas Collecting pandas Downloading https://files.pyt ...