Cloudflare show default nginx page

After switching to cloudflare my site is showing the default nginx page, without cloudflare the site was working smoothly, this makes me think there is a problem. Here is the nginx configuration file:
server {
root /var/www/minestore/public;
index index.php;
server_name store.atlasmc.it;
client_max_body_size 64m;

location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/store.atlasmc.it/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/store.atlasmc.it/privkey.pem; # 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 = store.atlasmc.it) {
# return 301 https://$host$request_uri;
# } # managed by Certbot


# listen 80;
# listen [::]:80;
# server_name store.atlasmc.it;
# return 404; # managed by Certbot


#}
server {
root /var/www/minestore/public;
index index.php;
server_name store.atlasmc.it;
client_max_body_size 64m;

location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/store.atlasmc.it/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/store.atlasmc.it/privkey.pem; # 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 = store.atlasmc.it) {
# return 301 https://$host$request_uri;
# } # managed by Certbot


# listen 80;
# listen [::]:80;
# server_name store.atlasmc.it;
# return 404; # managed by Certbot


#}
the commented part gave redirect problem with cloudflare. From nginx logs I see that it takes connection but cloudflare does not extract any content
2 Replies
ideals.life
ideals.life2y ago
when you setup nginx did you delete the default routing
isaac
isaacOP2y ago
I have already solved it, thank you anyway

Did you find this page helpful?