Forums

Getting 403 - Forbidden on all requests until reload of app

Hello! I've finally "finished" my Web App for now and opened it up for everyone to try. However, the site has become unavailable randomly, with everyone trying to access the site getting 403 errors. I can see them in the access logs, however there are no significant errors reported in the error log at that time.

I know this isn't much info to go on, but I'd be very happy if you could point me in the right direction as to what I could investigate to stop the error and keep my site up.

I'll gladly provide more info if anything may shed more light on the matter.

Thank you!

A 403 error is your code telling someone that they're not authorized to view a page; what kind of authentication are you doing in your code?

Hello, sorry to take so long to respond! I was caught up with some family stuff, I did not mean to abandon this topic.

Thank you for your answer! I figured it out.

For reference, I will write here what happened:

I installed and used flask-ipban to automatically ban IPs that try to access known paths hackers use, and also people who try to hack into users accounts by spamming passwords etc. However, and I don't quite understand why, after a while all access to the site is forbidden. There may be a lack of understanding in how IPs are handled here. My friend and I both got banned even though we did not even access the site in the time leading up to it. So the problem is not with pythonanywhere but with flask-ipban, or my setup of it. On reload, the ban-list is reset, so that is why it worked when reloading the page. Usually, every user who accesses the page should access it from their own IP, right? Is there some sort of other IP in play that comes between users and the site?

Thank you again for your response.

Michael

Hey, yes everyone connnecting will be from their own ip address. I'm would guess that the problem is with the path rules you've set up. It's probably blocking your real paths aswell as the one you want to block