VPS侦探论坛

 找回密码
 注册
查看: 2906|回复: 3

求助军哥,多域名配置问题

[复制链接]
发表于 2018-8-2 10:32:20 | 显示全部楼层 |阅读模式

部署网站时,用的是一个二级域名的,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.     }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2018-8-2 12:33:39 | 显示全部楼层


仅按上面贴出的配置看没有启用301的设置
如果没有其他相关配置,有可能程序上有相关的设置
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2018-8-2 14:05:05 | 显示全部楼层

回复 2# 的帖子


没有其他的配置了,如何启用301设置呢,
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2018-8-2 20:06:27 | 显示全部楼层



return 301
permanent 之类的都是设置301的
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-23 21:23 , Processed in 0.032410 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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