• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

nginx配置虚拟主机,访问了m.test.com变成了www.test.com

php 搞代码 4年前 (2022-01-23) 20次浏览 已收录 0个评论
文章目录[隐藏]

<body>

<code>server {    listen 80; # IPv4    server_name m.test.com;    ## Parametrization using hostname of access and log filenames.    access_log logs/localhost_access.log;    error_log logs/localhost_error.log;    ## Root and index files.    root html/test;    index  index.php index.html index.htm;    ## If no favicon exists return a 204 (no content error).    location = /favicon.ico {        try_files $uri =204;        log_not_found off;        access_log off;    }            ## Don't log robots.txt requests.    location = /robots.txt {        allow all;        log_not_found off;        access_log off;    }    ## Try the requested URI as files before handling it to PHP.    location / {        ## Regular PHP processing.        location ~ \.php$ {            try_files  $uri =404;            fastcgi_pass   php_processes;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;            include        fastcgi_params;        }        ## Static files        location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {            expires max;            log_not_found off;            ## No need to bleed constant updates. Send the all shebang in one            ## fell swoop.            tcp_nodelay off;            ## Set the OS file cache.            open_file_cache max=1000 inactive=120s;            open_file_cache_valid 45s;            open_file_cache_min_uses 2;            open_file_cache_errors off;        }        ## Keep a tab on the 'big' static files.        location ~* ^.+\.(?:ogg|pdf|pptx?)$ {            expires 30d;            ## No need to bleed constant updates. Send the all shebang in one            ## fell swoop.            tcp_nodelay off;        }        } # / location} </code>

访问了m.test.com之后
出错了。。。没起效

hosts文件也修改了
ping也通了

回复内容:

<body>

<code>server {    listen 80; # IPv4    server_name m.test.com;    ## Parametrization using hostname of access and log filenames.    access_log logs/localhost_access.log;    error_log logs/localhost_error.log;    ## Root and index files.    root html/test;    index  index.php index.html index.htm;    ## If no favicon exists return a 204 (no content error).    location = /favicon.ico {        try_files $uri =204;        log_not_found off;        access_log off;    }            ## Do<i style="color:transparent">本#文来源gaodai$ma#com搞$$代**码网$</i><button>搞代gaodaima码</button>n't log robots.txt requests.    location = /robots.txt {        allow all;        log_not_found off;        access_log off;    }    ## Try the requested URI as files before handling it to PHP.    location / {        ## Regular PHP processing.        location ~ \.php$ {            try_files  $uri =404;            fastcgi_pass   php_processes;            fastcgi_index  index.php;            fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;            include        fastcgi_params;        }        ## Static files        location ~* \.(?:css|gif|htc|ico|js|jpe?g|png|swf)$ {            expires max;            log_not_found off;            ## No need to bleed constant updates. Send the all shebang in one            ## fell swoop.            tcp_nodelay off;            ## Set the OS file cache.            open_file_cache max=1000 inactive=120s;            open_file_cache_valid 45s;            open_file_cache_min_uses 2;            open_file_cache_errors off;        }        ## Keep a tab on the 'big' static files.        location ~* ^.+\.(?:ogg|pdf|pptx?)$ {            expires 30d;            ## No need to bleed constant updates. Send the all shebang in one            ## fell swoop.            tcp_nodelay off;        }        } # / location} </code>

访问了m.test.com之后
出错了。。。没起效

hosts文件也修改了
ping也通了

<body>

浏览器为了加快访问速度,一般都有dns缓存,你先尝试完全退出chrome浏览器,然后再试

如果不行,访问chrome://net-internals/#dns,点击如下按钮

你是不是翻墙了吧。
要是翻墙了。就把vpn退了再试试。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:nginx配置虚拟主机,访问了m.test.com变成了www.test.com

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址