大网数据广告活动
服务器运维问答

An unknown domain serving contents of my sites

· 52CE 我爱测

I found that an unknown domain like www.aaa.com serving exactly the same contents (html, js ,css, any asset) of my site: myname.me . And the API as well, for example, www.aaa.com/api/user get the same response as myname.me/api/us…

问题原文

原帖链接 · Timothy Lee · CC BY-SA 4.0

I found that an unknown domain like www.aaa.com serving exactly the same contents (html, js ,css, any asset) of my site: myname.me.

And the API as well, for example, www.aaa.com/api/user get the same response as myname.me/api/user.

How can I block this domain from serving my thing?

How does it make this, redirect directly to my domain? Proxy? DNS?

I use VPS and I use nginx, here my nginx config, This is the redirection to https:

server {
    if ($host = example.me) {
        return 301 https://$host$request_uri;
    }

    listen 80 default_server;
    listen [::]:80 default_server;

    server_name example.me;
    return 404;
}

This is the proxy from https request to my application running on port 3000:

server {
    root /var/www/html/example
    server_tokens off;

    index index.html index.htm index.nginx-debian.html;

    server_name example.me;
    # add_header Cache-Control no-cache;

    location / {
        # First attempt to serve request as file, then as directory, then fall back to displaying a 404.
        # try_files $uri $uri/ =404;
        proxy_pass http://198.51.100.1:3000$request_uri;
    }
}

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

Your description says that another domain name you don't own has been set to your IP address, and web visitors to that domain therefore see your site.

To fix this, you need to restore the default nginx server block which shipped with nginx (or in this case, Ubuntu's custom version of the default server block). This default server block does not serve anything by default; everything reaching it gets the Debian "welcome to nginx" page. You should have separate server blocks for your own sites.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-06-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。