I bought my domain from Cloudflare
I can’t find any subdomain setup tutorial on Cloudflare that purchased the domain from Cloudflare.
I have two websites on the same server (ubuntu with nginx).
One: mydomain.com
Two: Sub.mydomain.com
I set up my cloudflare dns record
cname Sub.mydomain.com points to my ddns
like my domain name
I set up two domains in a different folder
all folders install WordPress individually
- try editing my subdomain conf (remove my main domain conf (like SSL certificate), this conf copy from main domain) (not work)
server {
listen 80;
server_name sub.mydomain.com;
client_max_body_size 500M;
}
server {
root /var/www/sub.mydomain.com/wordpress;
index index.php;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
-
Try to change my Cloudflare DNS record (not work)
Delete my subdomain point to ddns
add subdomain point to my dynamic IP
Even turn off Proxied set ttl 10 minutes etc -
install wordpress via wp cli on my subdomain folder (not work)
4.set cloudflare ssl to Flexible (not work)
- add define on my Subdomain wp-config.php (not work)
define('WP_HOME','https://Sub.mydomain.com');
define('WP_SITEURL','https://Sub.mydomain.com');
Jeffrey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.