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(或者其它应用入口文件)/模块/控制器/操作/[参 ...
随机推荐
- airflow 实战
def print_hello(*a,**b): print a print "=========" print b print 'Hello world!' raise Valu ...
- 4QC(四象限变流器)
1.什么是4QC? 4QC又叫四象限整流器 它是全控型晶闸管的整流电路,现在一般用水冷的IGBT组成的整流电路,它可以调节电压和电流,所谓的四象限就是 u+,i+,为第一象限: u-,i+.,为第二象 ...
- jpa持久化对象四种状态
自己理解,不完全正确,大致如下: 例:某实体类 Person(int id,string name,int age); id 为主键. 新建:new Person(), 并且未给 id 赋值 ...
- LeetCode 852 Peak Index in a Mountain Array 解题报告
题目要求 Let's call an array A a mountain if the following properties hold: A.length >= 3 There exist ...
- Java之旅_面向对象_抽象类
参考并摘自:http://www.runoob.com/java/java-abstraction.html Java抽象类: 在面向对象的概念中,所有的对象都是通过类来描绘的,但是反过来,并不是所有 ...
- xadmin与django-rest-framework的集成(1)
什么是xadmin?什么是django-rest-framework? xadmin是开源的一个类似于django自带的后台管理系统admin的开源模块,它基于bootstrap3框架,内置强大的插件 ...
- P1879 [USACO06NOV]玉米田Corn Fields 状压dp/插头dp
正解:状压dp/插头dp 解题报告: 链接! ……我真的太菜了……我以为一个小时前要搞完的题目调错误调了一个小时……90分到100我差不多搞了一个小时…… 然后这题还是做过的……就很气,觉得确实是要搞 ...
- axure rp pro 8.0 注册码
激活码:(亲测可用) 用户名:aaa 注册码:2GQrt5XHYY7SBK/4b22Gm4Dh8alaR0/0k3gEN5h7FkVPIn8oG3uphlOeytIajxGU 用户名:axureuse ...
- RN-系列
8081端口被占用,McAfee Agent关不掉 sudo lsof -n -i4TCP:8081 sudo launchctl list | grep 5693 sudo launchctl re ...
- git的reset的理解
git的reset的理解 1.在理解reset命令之前,先对git中涉及到的与该reset命令相关概念进行说明和解释HEAD这是当前分支版本顶端的别名,也就是在当前分支你最近的一个提交Indexind ...