1

I have a static html website on a Nginx web server. For a contact form I use the Formspree service.

<form action="https://formspree.io/your@email.com"
      method="POST">
    <input type="text" name="name">
    <input type="email" name="_replyto">
    <input type="submit" value="Send">
</form>

When I try to submit the completed form and the page needs to be redirected to the Formspree service, a 500 internal error appears.

the log error: "...client: 100.22.213.22, server: example.com, request: "POST / HTTP/1.1", host: "example.com", referrer: "https://example.com/"

What's the problem here?

1 Answers1

0

Ubuntu 18.04 LTS server

I need to configure Nginx, in this case the Nginx website configuration vhost file.

nano /etc/nginx/sites-enabled/example.com.vhost

server {
  listen 80 default_server;
  listen [::]:80 default_server;

  root /var/www/example;

  index index.html;

  server_name example.com www.example.com;

  // ADD THIS CODE TO WEBSITE WORK PROPERLY
  location / {
    try_files $uri $uri/ =404;
  }
}