VPS侦探论坛

 找回密码
 注册
查看: 4770|回复: 1

asiatrust部署完https访问403,http可以正常访问

[复制链接]
发表于 2021-5-14 07:05:30 | 显示全部楼层 |阅读模式

麻烦各位大佬帮忙看下代码,环境是lnmp1.7 centos 7.0
nginx1.18
mysql 5.7
php7.4

  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name www.abc.com abc.com;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /home/wwwroot/abc;
  8.                                
  9.         include rewrite/wordpress.conf;
  10.         #error_page   404   /404.html;

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

  13.         include enable-php.conf;

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

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

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

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

  29.         access_log  /home/wwwlogs/www.abc.com.log;
  30.     }
  31.        
  32.         server {
  33.     #SSL 访问端口号为 443
  34.     listen 443 ssl;
  35. #填写绑定证书的域名
  36.     server_name abc.com www.abc.com;
  37. #证书文件名称
  38.     ssl_certificate /usr/local/nginx/conf/1_abc.com_bundle.crt;
  39. #私钥文件名称
  40.     ssl_certificate_key /usr/local/nginx/conf/2_abc.com.key;
  41.     ssl_session_timeout 5m;
  42. #请按照以下协议配置
  43.     ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  44. #请按照以下套件配置,配置加密套件,写法遵循 openssl 标准。
  45.     ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
  46.     ssl_prefer_server_ciphers on;
  47.     location / {
  48.     #网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
  49.         root /home/wwwroot/abc;
  50.         index  index.html index.htm;
  51.     }
  52. }
复制代码







补充内容 (2021-5-14 09:26):
wordpress文件夹的属于用户www,有次更新插件要求填FTP就改成了这个  vhost里的nginx的conf文件所有者是root
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2021-5-14 09:40:49 | 显示全部楼层


不会自己写配置文件的话,将你自己写的配置内容删掉,直接用 lnmp ssl add 进行添加
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-21 00:40 , Processed in 0.049128 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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