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 配置文件的更多相关文章

  1. Nginx/Apache之伪静态设置 - 运维小结

    一.什么是伪静态伪静态即是网站本身是动态网页如.php..asp..aspx等格式动态网页有时这类动态网页还跟"?"加参数来读取数据库内不同资料,伪静态就是做url重写操作(即re ...

  2. nginx + SSL优化配置

    nginx + SSL优化配置: #http段添加如下配置项: http { ssl_prefer_server_ciphers on; #设置协商加密算法时,优先使用我们服务端的加密套件,而不是客户 ...

  3. nginx - ssl 配置 - globelsign ssl

    前提: 3个文件 - domain.csr.domain.key.xxx.cer 简述: 1. 本地生成 .key文件  [附件] 2. 再利用key文件,生成csr(certificate Secu ...

  4. shopnc B2B2C商城 Nginx下开启伪静态

    B2B2C商城 Nginx下开启伪静态,伪静态开启后,对系统的SEO极为有利,可以最大限度让商城页面被搜索引擎抓取,但在实际安装中,很多客户在这块都会遇到各种各样的问题. 1. 编辑商城配置文件(da ...

  5. Nginx SSL TLS部署最佳实践

    本文介绍nginx在提供HTTPS时使用的一些其他配置选项. 虽然这些功能有助于优化nginx的SSL和TLS,但这不是一个完整对加固nginx的介绍. 确保您的服务器安全的最佳方法是不仅需要正确的配 ...

  6. Nginx下wordpress伪静态规则(rewrite)

    当我们从apache服务器转向Nginx服务器的时候,它们的伪静态规则就不一样了,所以你熟悉Nginx服务器的伪静态规则,自己写当然也好.但很多网友还是不太了解Nginx服务器的伪静态规则的,而如果你 ...

  7. nginx支持pathinfo并且隐藏index.php

    How To Set Nginx Support PATHINFO URL Model And Hide The /index.php/ 就像这样 The URL before setting lik ...

  8. 解决NGINX的WORDPRESS伪静态规则失效的问题

    解决NGINX的WORDPRESS伪静态规则失效的问题 前两天搬到了EMSVPS的PR线路上,用上了最新的WDCP2.0管理面板,支持多用户管理(我们几个合租的VPS,最需要这个功能了),感觉很不错, ...

  9. 0109 ubuntu nginx ssl

    1. sudo apt-get install openssl libssl-dev # ./configure --with-http_stub_status_module --with-http_ ...

随机推荐

  1. hook的函数传入类

    简单记录 比如要hook一个app包中一个类的private void c(dmp dmp1),其中dmp是个类,这种的处理的方式如下: 用cydiasubstrate hook框架 1.先通过hoo ...

  2. 微信小程序——代码构成

    通过上一章讲解,我们了解到如何初始化一个小程序项目,这里是官方给到demo地址,通过demo来看教程更方便于我们理解项目架构. 由四种文件构成: .json 后缀的 JSON 配置文件 .wxml 后 ...

  3. JAVA程序员常用开发工具

    1.JDK (Java Development Kit)Java开发工具集 SUN的Java不仅提了一个丰富的语言和运行环境,而且还提了一个免费的Java开发工具集(JDK).开发人员和最终用户可以利 ...

  4. LINUX中块设备文件和字符设备文件的本质区别

    在LINUX系统文件类型分类的文章中我们提到了 块设备 和 字符设备文件,那么什么是块设备 字符设备文件呢?他们之间有什么本质上的区别呢? 设备文件分为 Block(块) Device Driver ...

  5. .Net深入体验与实践第一章

    什么是委托?委托和事件是什么关系? 我的理解是委托朋友,事件是一个事情比如,中午12点要吃饭了,咱家搞忘了!还在继续嗨皮,我的朋友会叫我与他一起吃饭. 什么事反射? 可以获取.Net中的每个类型(类, ...

  6. (一)安装Linux时的磁盘划分

    Linux安装中的磁盘划分 安装Ctentos6.3的版本,它使用的默认文件系统类型是ext4. Linux的安装至少要划分为根分区/和swap分区这个两个分区才能正常安装使用. 一般来说应该分为四个 ...

  7. EmailMessage类

    EmailMessage类 EmailMessage类 实例化有以下参数,注:以下所有参数都是可选的并且可以在send()方法之前任意时间设置. subject: email的主题 body: 主体内 ...

  8. Django应用的打包和应用的安装和卸载

    将应用打包需要安装: setuptools 安装和卸载应用需要安装: pip 举例polls是一个应用包. polls文件夹中包含所有有关应用的文件. 打包应用: 首先,在你的Django项目之外,为 ...

  9. 静态路由解决双外卡,PC做路由器的实现

    1,曾经医院,有两个网卡,一个内,一个外,但都有网关(192.168.1.246. 192. 168.6.1) 这样同一时候开启就会出现网络不通. 当时并没有细究原因. 这次医院信息化项目上马,我学到 ...

  10. MyBatis(2)增删改查

    本次全部学习内容:MyBatisLearning   查: 根据id查询用户信息,得到一个用户信息   在User.xml文件中添加代码: <mapper namespace="tes ...