How Can I reverse this redirect?

I have no idea how this happened but after moving my site ( into a new droplet from my old vps, while I was generating a Let’s Encrypt certificate a 301 re-direct has appeared to a completely non related domain ( on my server…

My question is - How can I best reverse This?

This is the HTTP Status:

:~$ curl -I
HTTP/2 301 
server: nginx
date: Sun, 06 Oct 2019 23:57:55 GMT
content-type: text/html; charset=UTF-8
expires: Wed, 11 Jan 1984 05:00:00 GMT
cache-control: no-transform, no-cache, must-revalidate, max-age=0
x-redirect-by: WordPress
strict-transport-security: max-age=31536000; includeSubdomains
content-security-policy: default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-content-type-options: nosniff 

this is the sites-enabled Host File:

:~$ cat /etc/nginx/sites-enabled/

server {


    access_log /home/;
    error_log /home/;

    root /home/;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$args; 

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;

    listen [::]:443 ssl http2; # managed by Certbot
    listen 443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

server {
    if ($host = {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    listen [::]:80;

    return 404; # managed by Certbot


This is the Nginx.conf file:

:~$ cat /etc/nginx/nginx.conf

user matt;
worker_processes 4;
pid /run/;
include /etc/nginx/modules-enabled/*.conf;

events {
	worker_connections 4096;
	multi_accept on;

http {

	# Basic Settings

	ssl_session_cache shared:SSL:10m;
	ssl_session_timeout 10m;	
	add_header Strict-Transport-Security "max-age=31536000; includeSubdomains";
	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 15;
	types_hash_max_size 2048;
	server_tokens off;
	client_max_body_size 64m;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	# SSL Settings

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
	ssl_prefer_server_ciphers on;

	# Logging Settings

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	# Gzip Settings

	gzip on;

	# gzip_vary on;
	gzip_proxied any;
	gzip_comp_level 2;
	# gzip_buffers 16 8k;
	# gzip_http_version 1.1;
	gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	# Cache Settings

	fastcgi_cache_key "$scheme$request_method$host$request_uri";
	add_header Fastcgi-Cache $upstream_cache_status;

	# Virtual Host Configs

	include /etc/nginx/conf.d/*.conf;
	include /etc/nginx/sites-enabled/*;

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;
    return 444;

server {
    listen 80;
    listen [::]:80;

    return 301 https://$server_name$request_uri;

	# Security

	add_header Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval';" always;
	add_header X-Xss-Protection "1; mode=block" always;
	add_header X-Frame-Options "SAMEORIGIN" always;
	add_header X-Content-Type-Options "nosniff" always;


Many thanks in advance for any guidance you can offer


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @thinknew,

It’s a bit hard looking at the configuration like that with yyyy and zzzz however from what I could see, everything looks alright. This leads me to believe the redirection is coming from your website/application rather than the Nginx configuration.

Is it by any chance possible you copied the website from to Check your database if you have hardcoded the website.

Another thing to check is your files and if you have hardcoded in there as well.

Kind regards, Kalin