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_ ...
随机推荐
- mysql 免安装版安装(window7)
初次使用mysql免安装版步骤: 1.设置环境变量,将mysql 加压文件路径添加到环境变量path中(作用是不用每次都切换路径) 控制面板>系统和安全>系统>高级系统设置 2.安装 ...
- Docker_1 安装Docker-CE
安装 免sudo运行docker命令 ustc mirrors service failed 安装 Docker-CE 安装过程参考官网,Ubuntu中如下: ## 1. 从仓库安装 $ sudo a ...
- canvas游戏和动画中的碰撞检测(2种简单方式)
碰撞检测关键步骤 碰撞检测需要处理经历下面两个关键的步骤: 计算判断两个物体是否发生碰撞 发生碰撞后,两个物体的状态和动画效果的处理 计算碰撞 只要两个物体相互接触,它们就会发生碰撞. 矩形物体碰撞检 ...
- Simotion 凸轮同步,偏移凸轮起点
将同步对象的 SyncingMotion.camReferenceBySlaveModeRelative 修改为 POSITION_AT_START_OF_CAMMING myRetDINT := _ ...
- python UI自动化实战记录六:页面1用例编写
使用python自带的unittest测试框架,用例继承自unittest.TestCase类. 1 引入接口类和页面类 2 setUp函数中打开页面,定义接口对象 3 tearDown函数中关闭页面 ...
- 树莓派(Raspberry Pi)上手小记
引言 本日志中有不少软广告,博主并没有收他们任何好处,完全是给想入手的小伙伴们指条路而已.不喜勿看,不喜勿闻,不喜勿喷. 介绍 之前两三个月突然听说了这么个东西,也没有留意,某天突然在一个微信公众号上 ...
- Django Url设计 小知识点
mysite/news/urls.py: from django.conf.urls import url from . import views urlpatterns = [ url(r'^art ...
- 小知识积累-linux下一些简单开发配置
系统环境为 redhat enterprise 6.x,主要是针对初学者在linux下用gcc和vi简单测试开发的一些配置 1.vi 自动换行 在终端下敲入vi命令打开文件 : vi ~/.vimrc ...
- Jupyter Notebook 设置黑色背景主题、字体大小、代码自动补全
1.背景主题.字体大小设置 安装Jupyter主题: pip install jupyterthemes 然后,更新Jupyter主题: pip install --upgrade jupyterth ...
- MFC自定义消息的实现方法
一.概述: 消息机制是windows程序的典型运行机制,在MFC中有很多已经封装好了的消息,如WM_BTN**等.但是在有些特殊情况下我们需要自定义一些消息去完成一些我们所需要的功能,这时候MFC的向 ...