Nginx配置Yii:backend&frontend
#My vlson.top project
#frontend
server {
listen 80;
server_name www.vlson.com; #charset koi8-r; set $app_root F:/vlson/advanced/frontend/web/;
set $project_root F:/vlson/advanced/frontend/;
root $app_root; access_log logs/frontend.access.log main; location / {
root $app_root;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
} error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root F:/vlson/frontend/web/;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php(.*)$ {
root F:/vlson/advanced/frontend/web/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
} #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)${
# #expires 30d;
# root $project_root;
#}
#location ~ .*\.(js|css)?${
# root $project_root;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
#My vlson.top project
#backend
server {
listen 80;
server_name backend.vlson.com;
client_max_body_size 5M; #charset koi8-r;
set $app_root F:/vlson/advanced/backend/web/;
set $project_root F:/vlson/advanced/backend/;
root $app_root; access_log logs/backend.access.log main; location / {
#root $app_root;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
} error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root $app_root;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php(.*)$ {
root F:/vlson/advanced/backend/web/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
Nginx配置Yii:backend&frontend的更多相关文章
- 针对Yii框架的nginx配置
我曾经针对yii制作了 个nginx配置,其中包括了以下几项内容: rewrite规则(try_file),需要nginx0.8.6版本以上支持. 针对于icon, robots.txt文件的日志优化 ...
- Nginx 配置简述
不论是本地开发,还是远程到 Server 开发,还是给提供 demo 给人看效果,我们时常需要对 Nginx 做配置,Nginx 的配置项相当多,如果考虑性能配置起来会比较麻烦.不过,我们往往只是需要 ...
- NGINX 配置 SSL 双向认证
对于 NGINX 的 HTTPS 配置,通常情况下我们只需要实现服务端认证就行,因为浏览器内置了一些受信任的证书颁发机构(CA),服务器端只需要拿到这些机构颁发的证书并配置好,浏览器会自己校验证书的可 ...
- 使用etcd+confd管理nginx配置
1.前言 最近在项目中用nginx做反向代理,需要动态生成nginx的配置.大概流程是用户在页面上新增域名.http或https协议以及端口信息,后台会根据域名自动生成一个nginx的server配置 ...
- nginx配置pathinfo支持,最佳方案 - chunyu
〇. 前言 pathinfo有两个,1 pathinfo()函数,2 $_SERVER['PATH_INFO'].pathinfo()是php的库函数,原生支持不需要nginx配置,$_SERVER[ ...
- Nginx配置了解
安装Nginx常用编译选项说明 nginx大部分常用模块,编译时./configure --help查看,以--without开头的都是默认安装. --prefix=PATH 指定nginx的安装目录 ...
- Nginx配置静态资源
静态服务器 静态服务器概念非常简单:当用户请求静态资源时,把文件内容回复给用户. 但是,要把静态服务做到极致,需要考虑的方面非常多: 正确书写header:设置content-type.过期时间等 效 ...
- Nginx 配置TCP代理
Nginx 1.9 版本以后增加了stream模块,可以对tcp,udp请求进行代理和负载均衡了,今天来体验一下首先编译安装过程configure的时候增加选项 --with-stream --wit ...
- 初识nginx——配置解析篇
一.nginx的介绍 nginx是由俄罗斯人开发的一款高性能的http和反向代理服务器,也可以用来作为邮件代理.相比较于其他的服务器,具有占用内存少,稳定性高等优势 二.nginx的配置 nginx的 ...
随机推荐
- 【4opencv】为基于OpenCV的图像处理程序编写界面—关于QT\MFC\CSharp的选择以及GOCW的介绍
基于OpenCV编写图像处理项目,除了算法以外,比较重要一个问题就是界面设计问题.对于c++语系的程序员来说,一般来说有QT/MFC两种考虑.QT的确功能强大,特别是QML编写andr ...
- (转)LoadRunner之录制你的第一个脚本
LoadRunner安装完成之后,肯定就迫不及待的想要上手试用了.下面就是讲一下LR脚本录制的流程和基本的设置. 1.先放一张脚本录制以及运行的流程图 2.脚本录制步骤 1)以管理员身份打开LR软件, ...
- odoo开发笔记 -- odoo权限管理
odoo框架 整体权限可以分为4个级别: (1) 菜单级别: 不属于指定菜单所包含组的用,看不到相应菜单.不安全,只是隐藏菜单,若用户知道菜单ID,仍然可以通过指定URL访问(2) 对象级别: 对某个 ...
- (原)ffmpeg中的writing_filter翻译
本文的主要目的是梳理,记录自己在学习开发ffmpeg视频滤镜的笔记.参考的主要内容是根据ffmpeg中doc下的writing_filter.txt文件以及ffmpeg的源码. author:liha ...
- Bladex之Arhcer代码生成器
代码生成器配置: 数据库表准备:Archer中增加对应的表:(参照test_notice和test_notice_list表)主表:SET FOREIGN_KEY_CHECKS=0; -- ----- ...
- fedora清理旧内核
先查看已安装的内核: rpm -qa|grep kernel 然后查看下当前在用的内核: uname -r 最后是删除内核: yum remove xxxx
- 启动Tomcat时报异常org.apache.catalina.core.ContainerBase.startInternal A child container failed during start
之前Tomcat一直运行正常,重启之后一直报以下错误信息: 13-Jun-2019 19:46:13.000 SEVERE [Catalina-startStop-1] org.apache.cata ...
- 「杂录」CSP-S 2019 爆炸记&题解
考试状况 \(Day1\) \(8:30\) 解压,先打个含头文件和\(freopen\)的模板程序,准备做题. \(8:35\) 开题,心想着按顺序做吧,毕竟难度一般是按顺序排的. 第一题,一眼看过 ...
- 自动化办公:xlsxwriter操作Excel
转载原链接:https://www.jianshu.com/p/d685cfaaeef7 1.安装 pip install xlsxwriter 2.操作一个简单的Excel文档 # 引入依赖模块 i ...
- SQL"已更新或者删除的行值要么不能使该行成为唯一行,要么改变了多个行(X行)“解决办法
这种问题大多是由于没有主键(PK)导致同一张表中存在若干条相同的数据.DBMS存储时,只为其存储一条数据,因为DBMS底层做了优化,以减少数据冗余.所以删除或更新一条重复数据就牵一发而动全身. 解决方 ...