0

I'm launching my php app in a docker container with nginx, php and fpm using

docker run -d -p 8080:80 -v `pwd`:/var/www/html --name myphpcontainer formapro/nginx-php-fpm

(See formapro/nginx-php-fpm image)

It correctly loads app.php in localhost:8080. As explained in formapro/nginx-php-fpm documentation, app.php is loaded by default.

But then my php application tries to do a POST to formsubmit.php and I get this error:

POST http://localhost:8080/formsubmit.php 404 (Not Found)

In fact, I can't even load http://localhost:8080/app.php or any php file in my app. What is the problem?

Mike
  • 1,296
  • 2
  • 15
  • 40

1 Answers1

0

From the sounds of it (app.php), you are running a framework. Which means you should be able to define pretty urls with their routing component. Check your framework's documentation for how to set up routes, your form action can then be set to for instance http://localhost:8080/some-custom-url with no .php file mentioned. It will go through app, and the router will determine where to send your request.

delboy1978uk
  • 12,118
  • 2
  • 21
  • 39