VPS侦探论坛

 找回密码
 注册
查看: 5047|回复: 7

已经安装了SSL证书,为什么还是http

[复制链接]
发表于 2017-8-27 10:24:22 | 显示全部楼层 |阅读模式

使用的lnmp1.4免费的SSL,已经安装完成,但是访问网站还是http,这是什么原因呢?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-8-28 08:22:27 | 显示全部楼层


你访问的http他就是http,访问的https就是https
如果想http全部跳到https 上,https://lnmp.org 上搜 301 找教程
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-8-28 08:54:19 | 显示全部楼层

回复 2# 的帖子


感谢军哥解答,但现在的问题是访问https网站打不开,访问http却可以
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-8-28 19:25:27 | 显示全部楼层

回复 3# 的帖子




信息有限,没有具体错误信息不好说
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2017-8-28 21:34:04 | 显示全部楼层

回复 4# 的帖子


使用的帝國cms,安装完成后直接访问是Http,访问正常,访问https就显示“无法访问此网站,”
conf配置如下:
  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name www.xxx.net xxx.net;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /home/wwwroot/xxx;

  8.         include none.conf;
  9.         #error_page   404   /404.html;

  10.         # Deny access to PHP files in specific directory
  11.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

  12.         include enable-php.conf;

  13.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  14.         {
  15.             expires      30d;
  16.         }

  17.         location ~ .*\.(js|css)?$
  18.         {
  19.             expires      12h;
  20.         }

  21.         location ~ /.well-known {
  22.             allow all;
  23.         }

  24.         location ~ /\.
  25.         {
  26.             deny all;
  27.         }

  28.         access_log  /home/wwwlogs/www.xxx.net.log;
  29.     }

  30. server
  31.     {
  32.         listen 443 ssl http2;
  33.         #listen [::]:443 ssl http2;
  34.         server_name www.xxx.net xxx.net;
  35.         index index.html index.htm index.php default.html default.htm default.php;
  36.         root  /home/wwwroot/xxx;
  37.         ssl on;
  38.         ssl_certificate /etc/letsencrypt/live/www.xxx.net/fullchain.pem;
  39.         ssl_certificate_key /etc/letsencrypt/live/www.xxx.net/privkey.pem;
  40.         ssl_session_timeout 5m;
  41.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  42.         ssl_prefer_server_ciphers on;
  43.         ssl_ciphers "此处省去:!MD5";
  44.         ssl_session_cache builtin:1000 shared:SSL:10m;
  45.         # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
  46.         ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

  47.         include none.conf;
  48.         #error_page   404   /404.html;

  49.         # Deny access to PHP files in specific directory
  50.         #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

  51.         include enable-php.conf;

  52.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  53.         {
  54.             expires      30d;
  55.         }

  56.         location ~ .*\.(js|css)?$
  57.         {
  58.             expires      12h;
  59.         }

  60.         location ~ /.well-known {
  61.             allow all;
  62.         }

  63.         location ~ /\.
  64.         {
  65.             deny all;
  66.         }

  67.         access_log  /home/wwwlogs/www.xxx.net.log;
  68.     }
复制代码

[ 本帖最后由 robin 于 2017-8-28 21:49 编辑 ]

军哥运维代购:http://shop63846532.taobao.com/

发表于 2017-8-29 13:05:48 | 显示全部楼层

回复 5# 的帖子


我要配置文件就和你说是配置文件了
环境是你vps的环境、网络环境、服务商

错误无法访问可能是本地没开443端口或者服务商防火墙没开443端口
 楼主| 发表于 2017-8-29 14:04:33 | 显示全部楼层

回复 6# 的帖子


一语惊醒梦中人,还真是端口的问题,现在问题已解决,感谢,现在遇到的问题是使用如下方式配置了301,但是访问http不跳转到https
  1. server {
  2. listen 80;
  3. server_name www.xxx.com;
  4. return 301 https://www.xxx.com$request_uri;
  5. }
复制代码

[ 本帖最后由 robin 于 2017-8-29 14:23 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2017-8-29 19:48:35 | 显示全部楼层

回复 7# 的帖子


这个需要结合前后的配置文件才能确定

有可能的原因,更改配置文件后未重启nginx
该域名已经存在或存在多个该域名的虚拟主机配置,重启时一般都会报错,反馈必读 帖子也有测试方法
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 11:20 , Processed in 0.027169 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表