Domain Mixed Up 301 Moved Permanently

What is the name of the domain?

lazuardinsani.com and puspidep.org

What is the error number?

301 Moved Permanently

What is the error message?

301 Moved Permanently

What is the issue you’re encountering

Domain Mixed Up 301 Moved Permanently puspidep.org redirece

What steps have you taken to resolve the issue?

change the ssl/tls to full

What are the steps to reproduce the issue?

i have multiple site hosted in one vps with different path with nginx. the first site lazuardinsani…com and the second one is puspidep…org. two days ago i applied both site with cloudflare and working properly without any problem. but two hours ago it started the error, when i open puspidep…org it automatically redirected to lazuardinsani…com
httppss://puspidep…org/
301 Moved Permanently
httppss://lazuardinsani…com/
403 Forbidden

curl -I httpp://puspidep…org
httpp/1.1 301 Moved Permanently
Date: Sat, 30 Nov 2024 15:47:41 GMT
Content-Type: text/html
Content-Length: 167
Connection: keep-alive
Cache-Control: max-age=3600
Expires: Sat, 30 Nov 2024 16:47:41 GMT
Location: httppss://puspidep…org/
Report-To: {“endpoints”:[{“url”:“httppss://a.nel.cloudflare…com/report/v4?s=RIdKinZsrXmYdgk3%2BS2Cg%2Fi%2FRsDG5y%2FIL6qtDSjBgmvGoOAXHFrdZuLpd3ZmAQuCOmIeZGPo3OP6s3tbTartPB73M%2Fbq9XrrpGVI7mGCrnjERUu20FmHcLReAH9bMe8%3D”}],“group”:“cf-nel”,“max_age”:604800}
NEL: {“success_fraction”:0,“report_to”:“cf-nel”,“max_age”:604800}
Server: cloudflare
CF-RAY: 8eabfa37d8e380c9-NRT
alt-svc: h3=“:443”; ma=86400
server-timing: cfL4;desc=“?proto=TCP&rtt=69513&min_rtt=69513&rtt_var=34756&sent=1&recv=3&lost=0&retrans=0&sent_bytes=0&recv_bytes=76&delivery_rate=0&cwnd=30&unsent_bytes=0&cid=0000000000000000&ts=0&x=0”

curl -I httppss://puspidep…org
httpp/2 403
date: Sat, 30 Nov 2024 15:48:16 GMT
content-type: text/html; charset=UTF-8
accept-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
critical-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
permissions-policy: accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()
referrer-policy: same-origin
x-content-options: nosniff
x-frame-options: SAMEORIGIN
cf-mitigated: challenge
cf-chl-out: +JN9KRiLYxvCuKLwNgsIOw2ugYuVY2AqaLKOnJNEDRC6Zzo75US1GTKrWA+WP0xMjBOX1U420LCrO1xguOex2f8F2D9aVU+0YzdU0jvDyQc=$qa9tP+tJ/jJpURmznf4qzQ==
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
report-to: {“endpoints”:[{“url”:“httppss://a.nel.cloudflare…com/report/v4?s=lvaslcxlgvoymMnY7VF%2FaAYVDVeWdQRNekizBv5ITkMhc33xvsvzBPm5df5oKFuZZbw%2F6Ov7uxcB1e7M5yqoF8DxnzGUDtzwzfHzFpdLpbq83rOq8Hr8VykMfqCZLEw%3D”}],“group”:“cf-nel”,“max_age”:604800}
nel: {“success_fraction”:0,“report_to”:“cf-nel”,“max_age”:604800}
server: cloudflare
cf-ray: 8eabfb14de348516-HKG
alt-svc: h3=“:443”; ma=86400
server-timing: cfL4;desc=“?proto=TCP&rtt=40586&min_rtt=40476&rtt_var=11602&sent=7&recv=10&lost=0&retrans=0&sent_bytes=2932&recv_bytes=574&delivery_rate=71467&cwnd=33&unsent_bytes=0&cid=98f8a4892a8211a7&ts=126&x=0”

here my nginx.conf:
user www;
worker_processes 1;

pid /var/run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 1024;
multi_accept on;
}

httpp {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
default_type application/octet-stream;
keepalive_timeout 15;
client_body_timeout 30;
client_header_timeout 30;
send_timeout 30;
client_max_body_size 64m;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
access_log /var/www/logs/access.log;
error_log /var/www/logs/error.log;
gzip on;
gzip_disable “msie6”;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 5;
gzip_httpp_version 1.1;
gzip_min_length 256;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;

upstream php82 {
	server unix:run/php-fpm.sock;
}

include /etc/nginx/upstreams/*.conf;

map '' $upstream {
	default php83;
}

server_tokens off;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
client_body_buffer_size 10K;
client_header_buffer_size 1k;
large_client_header_buffers 2 1k;
#limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
#limit_req zone=one burst=5;

include /etc/nginx/conf.d/*.conf;

}
and the lazuardi.conf
fastcgi_cache_path /var/www/lazuardinsani…com/cache/ levels=1:2 keys_zone=lazuardinsani…com:100m max_size=10g inactive=60m;

server {
listen 443;
listen [::]:443;
server_name lazuardinsani…com;

ssl_certificate /etc/ssl/lazuardinsani..com.fullchain.pem;
ssl_certificate_key /etc/ssl/private/lazuardinsani..com.key;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384';
ssl_ecdh_curve X25519:prime256v1:secp521r1:secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_stapling on;
ssl_stapling_verify on;
resolver 1.1.1.1 1.0.0.1 valid=60s;

server_tokens off;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block";
#add_header X-Content-Type-Options "nosniff" always;
#add_header Content-Security-Policy "default-src 'self';" always;
add_header Referrer-Policy "same-origin";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";

root /var/www/lazuardinsani..com/public;
access_log /var/www/lazuardinsani..com/logs/access.log;
error_log /var/www/lazuardinsani..com/logs/error.log;

index index.php;

error_page 404 /404.html;
location = /404.html {
    root /var/www/lazuardinsani..com/public;
    internal;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /var/www/lazuardinsani..com/public;
    internal;
}

location ~* /\.(?!well-known\/) {
    deny all;
}

location ~\.(ini|log|conf)$ {
    deny all;
}

location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
}

location ~* \.(?:manifest|appcache|html?|xml|json)$ {
    expires 0;
}

location ~* \.(?:rss|atom)$ {
    expires 1h;
}

location ~* \.(?:webp|ico|cur|gz|svg|mp4|mp3|ogg|ogv|webm|htc)$ {
    expires 1y;
    access_log off;
}

location ~* \.svgz$ {
    expires 1y;
    access_log off;
    gzip off;
}

location ~* \.(?:css|js)$ {
    expires 1y;
    access_log off;
}

location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
    expires 1y;
    access_log off;
    add_header Access-Control-Allow-Origin *;
}

location = /robots.txt {
    try_files $uri $uri/ /index.php?$args;
    access_log off;
    log_not_found off;
}

set $skip_cache 0;
if ($request_method = POST) {
    set $skip_cache 1;
}

if ($query_string != "") {
    set $skip_cache 1;
}

if ($request_uri ~* "/wp-admin/|/wp-json/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml|/cart/|/checkout/|/my-account/") {
    set $skip_cache 1;
}

if ($httpp_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|edd_items_in_cart|woocommerce_items_in_cart") {
    set $skip_cache 1;
}

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

location = /xmlrpc.php {
    deny all;
    access_log off;
    log_not_found off;
}

location /.well-known/acme-challenge/ {
    rewrite ^/.well-known/acme-challenge/(.*) /$1 break;
    root /acme;
}

location = /.well-known/acme-challenge/ {
	return 404;
}

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

    fastcgi_cache lazuardinsani..com;
    fastcgi_cache_key "$scheme$request_method$host$request_uri";
    fastcgi_cache_valid 200 301 302 10m;
    fastcgi_cache_valid 404 1m;
    fastcgi_cache_use_stale error timeout updating httpp_500 httpp_503;
    fastcgi_cache_bypass $skip_cache;
    fastcgi_no_cache $skip_cache;
    fastcgi_cache_lock on;
    fastcgi_pass_header Set-Cookie;
    fastcgi_pass_header Cookie;
    fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
    fastcgi_cache_lock_timeout 5s;
    fastcgi_cache_methods GET HEAD;
    add_header X-Fastcgi-Cache $upstream_cache_status;
    add_header Cache-Control "public, max-age=600";
}

}

server {
listen 80;
listen [::]:80;
server_name lazuardinsani…com;

return 301 httppss://lazuardinsani..com$request_uri;

}

server {
listen 80;
listen [::]:80;
server_name www.lazuardinsani…com;

return 301 httppss://lazuardinsani..com$request_uri;

}
and also the puspidep.conf
fastcgi_cache_path /var/www/puspidep…org/cache/ levels=1:2 keys_zone=puspidep…org:100m max_size=10g inactive=60m;

server {
listen 443;
listen [::]:443;
server_name puspidep…org;

ssl_certificate /etc/ssl/puspidep..org.fullchain.pem;
ssl_certificate_key /etc/ssl/private/puspidep..org.key;

ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384';
ssl_ecdh_curve X25519:prime256v1:secp521r1:secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_stapling on;
ssl_stapling_verify on;
resolver 1.1.1.1 1.0.0.1 valid=60s;

server_tokens off;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block";
#add_header X-Content-Type-Options "nosniff" always;
#add_header Content-Security-Policy "default-src 'self';" always;
add_header Referrer-Policy "same-origin";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Permissions-Policy "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()";

root /var/www/puspidep..org/public;
access_log /var/www/puspidep..org/logs/access.log;
error_log /var/www/puspidep..org/logs/error.log;

index index.php;

error_page 404 /404.html;
location = /404.html {
    root /var/www/puspidep..org/public;
    internal;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /var/www/puspidep..org/public;
    internal;
}

location ~* /\.(?!well-known\/) {
    deny all;
}

location ~\.(ini|log|conf)$ {
    deny all;
}

location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
}

location ~* \.(?:manifest|appcache|html?|xml|json)$ {
    expires 0;
}

location ~* \.(?:rss|atom)$ {
    expires 1h;
}

location ~* \.(?:webp|ico|cur|gz|svg|mp4|mp3|ogg|ogv|webm|htc)$ {
    expires 1y;
    access_log off;
}

location ~* \.svgz$ {
    expires 1y;
    access_log off;
    gzip off;
}

location ~* \.(?:css|js)$ {
    expires 1y;
    access_log off;
}

location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
    expires 1y;
    access_log off;
    add_header Access-Control-Allow-Origin *;
}

location = /robots.txt {
    try_files $uri $uri/ /index.php?$args;
    access_log off;
    log_not_found off;
}

set $skip_cache 0;
if ($request_method = POST) {
    set $skip_cache 1;
}

if ($query_string != "") {
    set $skip_cache 1;
}

if ($request_uri ~* "/wp-admin/|/wp-json/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml|/cart/|/checkout/|/my-account/") {
    set $skip_cache 1;
}

if ($httpp_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|edd_items_in_cart|woocommerce_items_in_cart") {
    set $skip_cache 1;
}

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

location = /xmlrpc.php {
    deny all;
    access_log off;
    log_not_found off;
}

location /.well-known/acme-challenge/ {
    rewrite ^/.well-known/acme-challenge/(.*) /$1 break;
    root /acme;
}

location = /.well-known/acme-challenge/ {
	return 404;
}

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

    fastcgi_cache puspidep..org;
    fastcgi_cache_key "$scheme$request_method$host$request_uri";
    fastcgi_cache_valid 200 301 302 10m;
    fastcgi_cache_valid 404 1m;
    fastcgi_cache_use_stale error timeout updating httpp_500 httpp_503;
    fastcgi_cache_bypass $skip_cache;
    fastcgi_no_cache $skip_cache;
    fastcgi_cache_lock on;
    fastcgi_pass_header Set-Cookie;
    fastcgi_pass_header Cookie;
    fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
    fastcgi_cache_lock_timeout 5s;
    fastcgi_cache_methods GET HEAD;
    add_header X-Fastcgi-Cache $upstream_cache_status;
    add_header Cache-Control "public, max-age=600";
}

}

server {
listen 80;
listen [::]:80;
server_name puspidep…org;

return 301 httppss://puspidep..org$request_uri;

}

server {
listen 80;
listen [::]:80;
server_name www.puspidep…org;

return 301 httppss://puspidep..org$request_uri;

}

The redirect is being done on your origin by Wordpress…

cache-control: public, max-age=600
cf-cache-status: DYNAMIC
cf-ray: 8eac1aa6b0d2d4ee-CDG
connection: keep-alive
content-type: text/html; charset=UTF-8
date: Sat, 30 Nov 2024 16:09:50 GMT
location: https://lazuardinsani.com/
server: cloudflare
transfer-encoding: chunked
x-fastcgi-cache: HIT
x-redirect-by: WordPress

https://cf.sjr.dev/tools/check?4253e1131d9241ffb0c65675a97702e8#connection-worker-http

As I see that redirect from a Worker, but am challenged when accessing directly, just check your Cloudflare SSL/TLS setting is set to “Full (strict)” as well.

1 Like

change both site ssl/tls to full strict and stil same, so the problem is the nginx?

It being done by your Wordpress installation…

can i delete this thread or at least edit it to remove my site domain?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.