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. python shopping incomplete code

    #shopping code#shopping.py#导入登录模块import login# shop car beginningsalary = input("请输入工资:\t" ...

  2. centos 克隆系统放到别的机器上后出现网卡启动不了的情况

      1. Remove Network Manager from startup Services. #chkconfig NetworkManager off 2. Add Default Net ...

  3. leetcode-valid number ZZ

    http://blog.csdn.net/kenden23/article/details/18696083 本题是十分麻烦的题目,情况是非常多,网上也很多方法,其中最有效,优雅的方法是有限状态自动机 ...

  4. C# 转换运算符:implicit(隐式),explicit(显示)

    //A类 class Cls1 { public string name; //构造函数 public Cls1(string name) { this.name = name; } //implic ...

  5. Python初学者第二天 用户输入和注释

    2day Python基础语法: 1.用户输入和注释 用户输入:   代码注释:# 注释部分不会被执行,或用来帮助理清代码逻辑   2.数据类型:数字 int:整数   long:长整形  注:Pyt ...

  6. 新浪OAuth网络登录,请求access_token时遇到21323的错误

    按照新浪给出的文档写了,但是遇到错误,总是获取不到token值,也是post方式提交的. 查阅百度资料,发现有网友给出了解决办法,是因为 文档中有这么一句提示: HTTP请求方式:POST 这句话太简 ...

  7. React v15.5.0更新说明 & v16.0.0更新预告

    React今日发布了15.5.0版本,同时这也将是以15开头的最后一个版本,下一次发布,我们将迎来React 16.0.0 在15.5.0这一版本中,主要有以下两处改动: 独立React.PropTy ...

  8. Ace admin 如何实现类似于freamset加载页面

    如上标题所述,ace admin做后台页面的时候,可以实现类似于用freamset的功能,但是ace admin做的比freamset更好,他可以用异步加载的形式展示,而加载的页面的内容可以尽可能的少 ...

  9. excel 在web导入到数据库的操作方法

    这个操作的大致步骤是把本地文件存入到服务器端,然后再读取服务端的文件并且使用NPOI这个第三方的插件去读取文件导入到数据库批量插入需要注意的是,前端需要使用form包裹type=file的文件标签,并 ...

  10. phonegap的照相机 API

    一. Camera Api 简单介绍 Camera 选择使用摄像头拍照,或从设备相册中获取一张照片.图片以 base64 编码的 字符串或图片 URI 形式返回. 方法: 1. camera.getP ...