I can't log in to my site

Hi! I can’t log in to my admin backend. It constantly kicks me out. There’s no error message. Just one moment after 10 tries I log in into my site and the next moment I get logged out. This issue started today.

I contacted my hosting provider to make sure that they don’t limit or blocking IP requests from the Cloudflare IPs. They said they weren’t blocking or limiting IP requests from the Cloudflare IPs.

How can I fix this problem?

My website is grozmer.ru

My first thought it might be related to the Web browser cookies or some HTTP-HTTPS issue? :thinking:

Web hosting support responded with the following:

We added 31.31.196.24 grozmer. ru www. grozmer. ru in /etc/hosts.

The admin panel under such conditions works without logging out (checked for 3 minutes).

Therefore, if you direct the site directly to the IP of the server, everything works correctly.

Carried out strace diagnostics of successful and unsuccessful authorization - did not find anything that could be lost on the Cloudflare side.

We recommend contacting Cloudflare support or connecting the site directly to the hosting to solve the problem.

So I need help from Cloudflare to solve this issue.

Kindly, I’d suggest you to write a ticket to Cloudflare support due to your account and/or domain issue and share the ticket number here with us so we could escalate this issue:

  • Login to Cloudflare and then contact Cloudflare Support by clicking on the Get More Help button. If you get automatic reply, reply and indicate to it you need more help and reference to this topic
  • Or send an an e-mail to support[at]cloudflare[dot]com from your e-mail associated with your Cloudflare account
1 Like

Your server seems to serve properly at https://grozmer.ru:

$ curl -X HEAD -I https://grozmer.ru/ --resolve 'grozmer.ru:443:31.31.196.24'
HTTP/2 200
server: nginx
date: Sat, 13 Aug 2022 04:15:30 GMT
content-type: text/html; charset=utf-8
vary: Accept-Encoding
x-powered-by: PHP/5.6.36
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
pragma: no-cache
set-cookie: PHPSESSID=65e33bded027545038e0024d1d106719; path=/
set-cookie: 1426be6f00174e4b05c9f91eeb9da453[logdate]=1660364130; expires=Mon, 12-Sep-2022 04:15:30 GMT; Max-Age=2592000; path=/; httponly

So for me, this seems to be a problem, related to not having restored the origin IP properly, as this will log you out regularly, or make you not beeing able to log in… Since you use Nginx please create a script and paste this in:

#!/bin/bash

# set temp file
CLOUDFLARE_FILE_PATH=/root/cloudflare-ips.txt

# prefill it for structure
echo "#Cloudflare" > $CLOUDFLARE_FILE_PATH;
echo "" >> $CLOUDFLARE_FILE_PATH;


# pipe IPv4 in
echo "# - IPv4" >> $CLOUDFLARE_FILE_PATH;
for i in `curl -s https://www.cloudflare.com/ips-v4`; do
    echo "set_real_ip_from $i;" >> $CLOUDFLARE_FILE_PATH;
done

# pipe IPv6 in
echo "" >> $CLOUDFLARE_FILE_PATH;
echo "# - IPv6" >> $CLOUDFLARE_FILE_PATH;
for i in `curl -s https://www.cloudflare.com/ips-v6`; do
    echo "set_real_ip_from $i;" >> $CLOUDFLARE_FILE_PATH;
done

# set "real ip header" config
echo "" >> $CLOUDFLARE_FILE_PATH;
echo "real_ip_header CF-Connecting-IP;" >> $CLOUDFLARE_FILE_PATH;

# move to nginx config folder
mv $CLOUDFLARE_FILE_PATH /etc/nginx/conf.d/cloudflare.conf


#check if everything is OK
nginx -t && printf "Valid\n" || printf "Error\n" | grep 'Valid' &> /dev/null
if [ $? == 0 ]; then
        echo "restaring nginx"
        service nginx restart
        echo "done"
else
        echo "something is wrong"
        mv /etc/nginx/conf.d/cloudflare.conf /etc/nginx/conf.d/cloudflare.conf-error
        echo "check cloudflare.conf-error file"
fi

Then make it executable with chmod +x SCRIPTNAME and execute it. This should solve the issue. But also add it as a cronjob, so it gets executed once a day. I did it like this:

0 * * * * /scripts/SCRIPTNAME.sh
@reboot /scripts/SCRIPTNAME.sh

Hope that helps.

2 Likes

Thank you for your reply! Could you clarify where I need to create the script?

I need to do it on my webhosting or Cloudflare account?

If it is on Cloudflare I’d really appreciate if you explain me where I need to make this script.

I’m sorry for bothering you. The thing is I’m not a technical guy so this is all technical stuff is hard for me.

сб, 13 авг. 2022 г. в 07:30, M4rt1n via Cloudflare Community <[email protected]>:

Just hire a developer, if you can’t do it yourself.

You need to create that script anywhere on your server. But you also need root-privileges for this script to run. Also execute it as root.

Then add it to the cronjobs again - as root.

1 Like

Thank you! I’ll try this.

сб, 13 авг. 2022 г. в 12:40, M4rt1n via Cloudflare Community <[email protected]>:

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