403 OpenResty Error when submitting forms in Laravel. Working locally, but not in live

Website URL

Domain: https://tsek.infinityfreeapp.com/admin-program-management

Error Message

Domain: tsek.infinityfreeapp.com

Request: POST /admin-college-management

Response: 403 Forbidden generated by OpenResty

Both valid and blank submissions fail.

The application uses Laravel, and the same functionality works locally.

Other Information

I’m using AJAX, the form with AJAX getting a 403 OpenResty error while those who don’t have AJAX are okay.

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

Does the AJAX request go to exactly https://tsek.infinityfreeapp.com/admin-college-management, on the same domain as the page it’s sent from? In your browser’s developer tools, Network tab, check the full request URL of the failing POST. Also tell me whether the 403 response body mentions aes.js or “requires Javascript”, or is just a plain OpenResty page.

I ask because our browser security check lets AJAX calls through when they stay on your own domain, but it blocks cross-domain ones. The article below covers this.

A Laravel app that builds its URLs from APP_URL or a hardcoded localhost address, or that mixes http/https or a different hostname, would send the AJAX call to a different origin than the page. That would explain why it works locally and why normal form posts are fine. It’s only a guess until I see the request URL.