nginx ssl pathinfo 伪静态 301 配置文件
server {
listen ;
root /www/web/test_com/public_html;
server_name test.com test.com;
if ($host != '***.com')
#注意,这里很严格,if后面要有空格,!=两边都是空格。
{
rewrite ^/(.*)$ https://www.***.com/$1 permanent;
}
if ($scheme = http ) {
return https://www.***.com$request_uri;
}
index index.html index.php index.htm;
error_page /errpage/.html;
error_page /errpage/.html;
error_page /errpage/.html;
error_page /errpage/.html;
#location ~ \.php(.*)$ {
# fastcgi_pass unix:/tmp/php--cgi.sock;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;
# fastcgi_param PATH_INFO $;
# include fcgi.conf;
#}
location ~ \.php {
fastcgi_pass unix:/tmp/php--cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $;
set $path_info $;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location ~ /\.ht {
deny all;
}
location / {
try_files $uri $uri/ /?$args;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$ last;
rewrite ([a-z_A-Z-\s.+-]+)/([-]+)_([-]+)\.html$ /index.php/Index/shows/catid/$/id/$ last;
rewrite ([a-z_A-Z-\s.+-]+)\.html$ /index.php/Index/jump/catdir/$ last;
break;
}
}
server {
listen ;
root /www/web/test_com/public_html;
ssl on;
ssl_certificate cert/test_com.crt;
ssl_certificate_key cert/test_com.key;
ssl_prefer_server_ciphers on;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1. TLSv1.;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
server_name test.com test.com;
if ($host != '***.com')
#注意,这里很严格,if后面要有空格,!=两边都是空格。
{
rewrite ^/(.*)$ https://www.***.com/$1 permanent;
}
if ($scheme = http ) {
return https://www.***.com$request_uri;
}
index index.html index.php index.htm;
error_page /errpage/.html;
error_page /errpage/.html;
error_page /errpage/.html;
error_page /errpage/.html;
location ~ \.php {
fastcgi_pass unix:/tmp/php--cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $;
set $path_info $;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
location ~ /\.ht {
deny all;
}
location / {
try_files $uri $uri/ /?$args;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$ last;
rewrite ([a-z_A-Z-\s.+-]+)/([-]+)_([-]+)\.html$ /index.php/Index/shows/catid/$/id/$ last;
rewrite ([a-z_A-Z-\s.+-]+)\.html$ /index.php/Index/jump/catdir/$ last;
break;
}
}
nginx ssl pathinfo 伪静态 301 配置文件的更多相关文章
- Nginx/Apache之伪静态设置 - 运维小结
一.什么是伪静态伪静态即是网站本身是动态网页如.php..asp..aspx等格式动态网页有时这类动态网页还跟"?"加参数来读取数据库内不同资料,伪静态就是做url重写操作(即re ...
- nginx + SSL优化配置
nginx + SSL优化配置: #http段添加如下配置项: http { ssl_prefer_server_ciphers on; #设置协商加密算法时,优先使用我们服务端的加密套件,而不是客户 ...
- nginx - ssl 配置 - globelsign ssl
前提: 3个文件 - domain.csr.domain.key.xxx.cer 简述: 1. 本地生成 .key文件 [附件] 2. 再利用key文件,生成csr(certificate Secu ...
- shopnc B2B2C商城 Nginx下开启伪静态
B2B2C商城 Nginx下开启伪静态,伪静态开启后,对系统的SEO极为有利,可以最大限度让商城页面被搜索引擎抓取,但在实际安装中,很多客户在这块都会遇到各种各样的问题. 1. 编辑商城配置文件(da ...
- Nginx SSL TLS部署最佳实践
本文介绍nginx在提供HTTPS时使用的一些其他配置选项. 虽然这些功能有助于优化nginx的SSL和TLS,但这不是一个完整对加固nginx的介绍. 确保您的服务器安全的最佳方法是不仅需要正确的配 ...
- Nginx下wordpress伪静态规则(rewrite)
当我们从apache服务器转向Nginx服务器的时候,它们的伪静态规则就不一样了,所以你熟悉Nginx服务器的伪静态规则,自己写当然也好.但很多网友还是不太了解Nginx服务器的伪静态规则的,而如果你 ...
- nginx支持pathinfo并且隐藏index.php
How To Set Nginx Support PATHINFO URL Model And Hide The /index.php/ 就像这样 The URL before setting lik ...
- 解决NGINX的WORDPRESS伪静态规则失效的问题
解决NGINX的WORDPRESS伪静态规则失效的问题 前两天搬到了EMSVPS的PR线路上,用上了最新的WDCP2.0管理面板,支持多用户管理(我们几个合租的VPS,最需要这个功能了),感觉很不错, ...
- 0109 ubuntu nginx ssl
1. sudo apt-get install openssl libssl-dev # ./configure --with-http_stub_status_module --with-http_ ...
随机推荐
- NgModelController: $setViewValue,$render,Formatter, Parser
NgModelController为ngModel directive提供了API.这个controller包含了关于data-binding,validation,css update, value ...
- tcp-full.cc
ns2--tcp-full.cc /* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- */ /* * Copy ...
- leetcode Ch1-search 2014
1. Search Insert Position class Solution { public: int searchInsert(int A[], int n, int target) { ,r ...
- 微软操作系统 Windows Server 2012 R2 官方原版镜像
微软操作系统 Windows Server 2012 R2 官方原版镜像 Windows Server 2012 R2 是由微软公司(Microsoft)设计开发的新一代的服务器专属操作系统,其核心版 ...
- 浅谈js冒泡事件1
什么是JS事件冒泡?: 在一个对象上触发某类事件(比如单击onclick事件),如果此对象定义了此事件的处理程序,那么此事件就会调用这个处理程序,如果没有定义此事件处理程序或者事件返回true,那么这 ...
- 如何退出virtualbox scale mode
进入scale mode之后,可能会退不出来 HOST Key + C. 默认是 右Ctrl + C
- ZT 初始化 const 成员和引用类型成员(C++)
初始化 const 成员和引用类型成员(C++) 初始化 const 成员和引用类型成员的问题,在 C++ 教材中讲述初始化列表的章节应该都有讲过,但是因为平时用得少,所以可能有不少人没注意到.待到用 ...
- 智能指针之auto_ptr和scoped_ptr
部分参考地址https://blog.csdn.net/yanglingwell/article/details/56011576 auto_ptr是c++标准库里的智能指针,但是具有以下几个明显的缺 ...
- checkbox的readonly属性设置
方式一: checkbox没有readOnly属性,如果使用disabled=“disabled”属性的话,会让checkbox变成灰色的,用户很反感这种样式可以这样让它保持只读: 设置它的oncli ...
- FBKVOController代码阅读
功能:对kvo机制进行封装,简化使用,简化内存管理: 要素:观察者.被观察者.处理函数. 模式:注册表模式: 机制:对象创建.注册管理.内存管理.处理机制转换: 其它:注册去重: kvo的管理机制: