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配置伪静态的更多相关文章

  1. nginx配置伪静态

    最近做门户网站,使用了的nginx重写规则 项目目录下写好 nginx.conf文件 然后在打开nginx配置文件,在server引入对应的重写规则的文件就可以了 当然直接写在配置里面 locatio ...

  2. Nginx配置-伪静态,隐藏index.php大入口

    server { listen ; server_name ; root E:/www/wvtuan/; index index.php index.html; log_not_found off; ...

  3. 记一次nginx配置伪静态规则

    server { listen 80; server_name sss.cn; root "root/"; location / { index index.html index. ...

  4. Nginx 服务器伪静态配置不当造成 Access denied

    Nginx 服务器伪静态配置不当造成 Access denied 有群有反馈将 FastAdmin 布署到阿里云后无法打开后台. 出现如下提示,首页是可以打开,点登录链接后出现的.(下是群友的截图) ...

  5. 【转】 nginx rewrite 伪静态配置参数详细说明

    nginx rewrite 伪静态配置参数和使用例子 附正则使用说明 正则表达式匹配,其中: * ~ 为区分大小写匹配  * ~* 为不区分大小写匹配  * !~和!~*分别为区分大小写不匹配及不区分 ...

  6. thinkphp nginx 配置

    thinkphp convention配置:'URL_MODEL' => '2', //URL模式 nginx rewrite配置: if (!-e $request_filename) { r ...

  7. 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 ...

  8. Nginx的使用(二)Nginx配置wordpress

    安装php:https://windows.php.net/download/,php默认启动命令:php-cgi.exe -b 127.0.0.1:9000 安装wordpress:https:// ...

  9. tp5中nginx配置

    首先tp5的访问目录指向到webroot/public文件夹中. thinkphp的url访问:http://serverName/index.php(或者其它应用入口文件)/模块/控制器/操作/[参 ...

随机推荐

  1. 转:JAVA中解决Filter过滤掉css,js,图片文件等问题

    原文链接:https://www.cnblogs.com/ermeng/p/6440966.html public void doFilter(ServletRequest request, Serv ...

  2. 20165336 实验三 敏捷开发与XP实践

    20165336 实验三 敏捷开发与XP实践 一.实验报告封面 课程:Java程序设计 班级:1653班 姓名:康志强 学号:20165336 指导教师:娄嘉鹏 实验日期:2018年4月28日 实验时 ...

  3. java上传文件代码

    import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;impo ...

  4. nodejs 学习四 处理回调地狱

    面对下面回调,你面对这样代码,你心里难道不百万只羊驼吗? nodejs 提供了util.promisify方法,来解决这类问题.(类似es6 种是提供了Promise的方法). const fs = ...

  5. Spring 配置文件出现异常!

    spring配置文件错误 Referenced file contains errors (http://www.springframework.org/schema/beans/spring-bea ...

  6. 31-ADC模拟/数字转换

    31-ADC模拟/数字转换 (1).ADC的IO分配

  7. SpringBoot-整合lombok

    添加lombok依赖 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lom ...

  8. Filter & Listener

    一 监听器的概述 监听器就是一个实现了特定接口的Java类,用于监听另一个Java类的方法调用或属性的改变.当被监听对象发生上述事件后,监听器某个方法将会立即被执行. 即用来监听其他对象的变化,主要应 ...

  9. Docker镜像推送(push)到Docker Hub

    镜像构建成功后,只要有docker环境就可以使用,但必须将镜像推送到Docker Hub上去.我们之前创建的镜像不符合Docker Hub的tag要求,因为 在Docker Hub注册的用户名是boo ...

  10. 20180820 SQL 提示Error: String or binary data would be truncated

    Error: String or binary data would be truncated,错误,是因为栏位给出的长度不够,增加初始化长度就可以了. 除了创建表的增加长度情况,还有一种是,SELE ...