VPS侦探论坛

标题: 求助军哥,多域名配置问题 [打印本页]

作者: 浅夏的黑夜    时间: 2018-8-2 10:32
标题: 求助军哥,多域名配置问题
部署网站时,用的是一个二级域名的,uu.yyyyy.cn   vhost下的配置文件是uu.yyyyy.cn.conf   现在我想绑定三个域名,www.aaa.com   www.aaa.cn    www.aaa.net但是只有访问www.aaa.cn  和uu.yyyyy.cn才能访问得了网站   www.aaa.com  和 www.aaa.net都跳转至https://uu.yyyyy.cn而访问不了,  后面这三个域名都备案过了的,

  1. server
  2.     {
  3.         listen 80;
  4.         #listen [::]:80;
  5.         server_name www.aaa.com www.aaa.cn www.aaa.net uu.yyyyy.cn;
  6.         index index.html index.htm index.php default.html default.htm default.php;
  7.         root  /home/wwwroot/uu;

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

  10.         #rewrite ^/(.*) https://$server_name/$1 permanent;

  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 / {
  19.             index  index.php index.html index.htm;
  20.              #如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
  21.              if (!-e $request_filename)
  22.              {
  23.                 #地址作为将参数rewrite到index.php上。
  24.                 rewrite ^/(.*)$ /index.php?s=$1;
  25.                 #若是子目录则使用下面这句,将subdir改成目录名称即可。
  26.                 #rewrite ^/subdir/(.*)$ /subdir/index.php?s=$1;
  27.              }
  28.         }
  29.         location ~ .*\.(js|css)?$
  30.         {
  31.             expires      12h;
  32.         }

  33.         location ~ /.well-known {
  34.             allow all;
  35.         }

  36.         location ~ /\.
  37.         {
  38.             deny all;
  39.         }

  40.         access_log  /home/wwwlogs/uu.yyyyy.cn.log;
  41.     }
复制代码

作者: licess    时间: 2018-8-2 12:33
仅按上面贴出的配置看没有启用301的设置
如果没有其他相关配置,有可能程序上有相关的设置
作者: 浅夏的黑夜    时间: 2018-8-2 14:05
标题: 回复 2# 的帖子
没有其他的配置了,如何启用301设置呢,
作者: licess    时间: 2018-8-2 20:06
return 301
permanent 之类的都是设置301的




欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/) Powered by Discuz! X3.4