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. 显示日历的指令:cal

    1.显示日历的指令:cal (1)参数: (2)实例:

  2. spring boot 使用视图modelandview

    1:springboot使用视图解析器,添加依赖 <!-- freemarker模板引擎视图 --> <dependency> <groupId>org.sprin ...

  3. k8s 健康检查

    livenessProbe: exec: command: - /bin/sh - '-c' - /opt/app-root/src/check_conf.sh failureThreshold: 3 ...

  4. SecureCRT乱码问题的解决

    == 安装后默认的设置是utf8,不是汉字乱码,是一块一块的看不清,OMG... 设置这两个页面就好了

  5. APP网络优化篇

    Android Addresses are cached for 600 seconds (10 minutes) by default. Failed lookups are cached for ...

  6. phpstudy安装redis

    php安装扩展,首先要在php官网下载相应的库文件, http://pecl.php.net/package/redis 下载相应版本的文件,首先phpinfo()看看当前的php环境版本等等   我 ...

  7. iOS 开发笔记-获取某个APP素材

    2019.02.01 更新 以下这种方式只适合越狱的手机,目前12.1以后,iTools已经不适合了,请看最下面第二种方式. 有时候,我们看到别人的APP做得挺漂亮的,那么我们想查看该APP的图片素材 ...

  8. jenkins构建多个项目执行顺序设置

    通常我们会在jenkins中构建多个项目,那么如果项目有依赖,或者有关联怎么办?  例: 如下图: ,有两个构建项目,posWeb是个web项目,welife是接口项目. 由于接口项目数据会影响pos ...

  9. 漏洞复现:Struts2 S2-032 漏洞环境

    Struts2 S2-032 漏洞环境 http://vulapps.evalbug.com/s_struts2_s2-032/ POC: http://127.0.0.1/memoindex.act ...

  10. bootstrap ui

    附加访问地址:http://www.bootcss.com/p/jquery-ui-bootstrap/