Nginx 配置笔记
2016-07-08 14:30
453 查看
引子
本篇记录学习 nginx 的点滴主要配置
整合 ThinkPHP
vim nginx.conf location / { root /var/www/html; index index.html index.php; # ThinkPHP hide index.php try_files $uri $uri/ /index.php?s=$uri&$args; } location ~ \.php { root /var/www/html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi.conf; }
设置 HTTPS
listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl_certificate server.crt; # 注意 bundle.crt ssl_certificate_key server.key; # 强制 HTTPS server { listen 80; rewrite ^(.*)$ https://$host$1 permanent; } server { listen 443; # blahblah.... }
参考资料
https://s.how/nginx-ssl/相关文章推荐
- 一个关于if else容易迷惑的问题
- nginx代理指定目录
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- 访问Nginx发生SSL connection error的一种情况
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- Nginx+Naxsi部署专业级Web应用防火墙
- 什么是设计模式
- CentOS 6.2实战部署Nginx+MySQL+PHP
- PHP数据库长连接mysql_pconnect的细节
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- Php Installing An Expansion
- Nginx 学习笔记(一)
- rem : web app适配的秘密武器