内容简介:发表于 2018-11-11 19:18:30 by月小升简单配置Nginx SSl
发表于 2018-11-11 19:18:30 by月小升
简单配置
server {
listen 81;
server_name java-er.com;
root /www/java-er.com;
location / {
index index.html index.htm index.php;
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
Nginx SSl
ssl on;
ssl_certificate /www/javaer.com/ssl/full_chain.pem;
ssl_certificate_key /www/javaer.com/ssl/private.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
WordPress 的URLREWRITE
if (!-e $request_filename){
rewrite (.*) /index.php;
}
完整配置
server {
listen 80;
listen 443 ssl; #监听两个端口
server_name java-er.com;
root /www/javaer.com;
ssl_certificate /www/javaer.com/ssl/full_chain.pem;
ssl_certificate_key /www/javaer.com/ssl/private.key;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite (.*) /blog/index.php;
}
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
php-fpm 的理解
1. 客户端通过http协议访问网站域名
2. Nginx接受请求,并路由转到index.php
3. 加载fastcgi模块
4. Fastcgi监听127.0.0.1:9000地址
5. 然后访问到达127.0.0.1:9000
6. php-fpm 监听127.0.0.1:9000,也就接收到了请求
7. Fpm的master主进程,分配子进程去处理请求
8. 处理完成后,返回结果给 nginx
9. Nginx通过http协议响应给客户端
- Centos7.4 nginx yum 自动升级php-fpm为 php 7
- 如何缓存wordpress
- wordpress模板编写插件CSS丢失
- wordpress模板开发,判断页面类型
- wordpress 不用ftp更新系统和插件
- wordpress忘记密码
- nginx 在centos7.2下报Failed to restart nginx.service: Unit nginx.service failed to load:
- nginx 图片上传413 Request Entity Too Large
- centos 下 自己编译php-fpm
- wordpress的$wpdb函数
- 为wordpress编写一个插件
- 负载均衡如何做,负载均衡的几个方案
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
架构真经
马丁L. 阿伯特(Martin L. Abbott)、迈克尔T.费舍尔(Michael T. Fisher) / 机械工业出版社 / 2017-4 / 79
前言 感谢你对本书第2版感兴趣!作为一本入门、进修和轻量级的参考手册,本书旨在帮助工程师、架构师和管理者研发及维护可扩展的互联网产品。本书给出了一系列规则,每个规则围绕着不同的主题展开讨论。大部分的规则聚焦在技术上,少数规则涉及一些关键的思维或流程问题,每个规则对构建可扩展的产品都是至关重要的。这些规则在深度和焦点上都有所不同。有些规则是高级的,例如定义一个可以应用于几乎任何可扩展性问题的模......一起来看看 《架构真经》 这本书的介绍吧!
RGB转16进制工具
RGB HEX 互转工具
RGB HSV 转换
RGB HSV 互转工具