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的 ...
随机推荐
- eclispe: 修改所有文件默认编码为UTF-8
1.修改 workspace text file encoding 依次点击windows -> Preferences -> general -> Workspace,修改如图的编 ...
- 【基础】Qt SCXML Calculator QML Example
Qt SCXML Calculator QML Example 这个系统自带的例子原本主要是用来说明SCXML机制的,但是由于计算器的经典和简洁,我认为用来练习QML非常合适,原本的例子还有一些问题, ...
- 阿里云mysql数据库恢复到本地
本地环境为win10,mysql引擎为InnoDB 第一步:服务里面停掉mysql 第二步:把my.ini 的 innodb_force_recovery 设置为0 第三步:把.frm和.idb文件 ...
- Java基础 awt Button 鼠标放在按钮上背景颜色改变,鼠标离开背景颜色恢复
JDK :OpenJDK-11 OS :CentOS 7.6.1810 IDE :Eclipse 2019‑03 typesetting :Markdown code ...
- 运维笔记--Docker文件占用磁盘空间异常处理
场景描述: 1. 服务器运行一段时间后,发现系统盘磁盘空间在不断增加,一开始的时候,不会影响系统,随着时间的推移,磁盘空间在不断增加,直到有一天你会发现系统盘剩余空间即将使用完,值得庆幸的是,如果您使 ...
- Android Studio 3.0——unable to resolve dependency for cordovalib
Android Studio 3.0 更新了gradle后,项目竟然开始报错unable to resolve dependency for cordovalib...打开build.gradle看了 ...
- iOS开发 判定某个时间是否属于这个时间段
- (BOOL)isBetweenDate { //设置的是中国时间 NSString *startTime=@"13:01"; NSString *expireTime=@&qu ...
- 上传下载execl
ajax上传execl + easyexecl解析execl <!DOCTYPE html> <html> <head> <meta charset=&quo ...
- LeetCode_475. Heaters
475. Heaters Easy Winter is coming! Your first job during the contest is to design a standard heater ...
- 'object ''/usr/local/lib/libdns.so'' from /etc/ld.so.preload cannot be preloaded: ignored.'
做了如下操作后: rm -rf xxx.jar kill -9 xx 重启Jar包,出现如下错误: ld.so: object '/usr/local/lib/libdns.so' from /etc ...