nginx添加301跳转到HTTPS并保留部分80端口的URL
来源:互联网 发布:淘宝客推广计划 编辑:程序博客网 时间:2024/04/30 00:50
为什么有这个需求,因为Let’s Encrypt的证书有一个URL必须在80端口认证,很多配置都是全跳到https这就有问题了
参考文章:http://www.tuicool.com/articles/NVNvUf3
主要是配两个server,80端口配置Let’s Encrypt认证的URL和跳转,443端口的配置SSL
我的配置如下
server { listen 80; #listen [::]:80; server_name blog.vvvtimes.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/blog.vvvtimes.com; #error_page 404 /404.html; location ~ /.well-known/acme-challenge/(.*) { default_type text/plain; } location / { return 301 https://$server_name$request_uri; } access_log /home/wwwlogs/blog.vvvtimes.com.log; }server { listen 443 ssl; #listen [::]:80; server_name blog.vvvtimes.com; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/blog.vvvtimes.com; ssl_certificate /etc/letsencrypt/live/www.vvvtimes.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/www.vvvtimes.com/privkey.pem; ssl_ciphers "EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5"; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; include wordpress.conf; #error_page 404 /404.html; include enable-php.conf; location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { expires 30d; } location ~ .*\.(js|css)?$ { expires 12h; } location ~ /\. { deny all; } access_log /home/wwwlogs/blog.vvvtimes.com.log; }
0 0
- nginx添加301跳转到HTTPS并保留部分80端口的URL
- 使用nginx实现http访问自动跳转到https端口
- Nginx配置SSL并强制http跳转到https
- nginx http 跳转到https
- nginx的http和https 301跳转
- Nginx配置http强制跳转到https
- Nginx跳转任意Http请求到Https
- Nginx安装配置SSL证书并强制http跳转到https
- nginx 配置二级域名跳转以及www 跳转(去除www 跳转),nginx 端口跳转,nginx 保留IP信息
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx网站开启https访问,http自动跳转到https
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx强制使用https访问(http跳转到https)
- nginx 配置https访问以及访问http跳转到https
- HDU 2537 8球胜负
- Professional JavaScript for Web Developers 读书笔记(一)
- ios打印功能实现(ScrollerView打印)
- spoj375树链剖分模板
- redis之父的博客翻译-Redis中的LRU算法改进
- nginx添加301跳转到HTTPS并保留部分80端口的URL
- 思维的转变:从工程师到架构师再到技术TL
- 一致性哈希算法
- ubuntu 16 开启cron服务
- android之aidl研究(2)
- tkinter 自动刷新高度可控的内容
- 写一个宏可以将一个数字的奇数位和偶数位交换。
- 周易六十四卦——地风升卦
- AjaxPro使用说明