Question

Contact form doesn't work on Ubuntu VPN- DigitalOcean - error 405 Not Allowed nginx/1.4.6 (Ubuntu)

I am hosting my website on VPN- DigitalOcean.

I installed NGinx, sendmail packages on ubuntu but I kept trying to

I kept having this problem whenever I try to send an email through contact form. The contact form uses php script ** 405 Not Allowed nginx/1.4.6 (Ubuntu) **

I tried different solutions I found on the internet like this but couldnt overcome the problem.

Any advise on how to solve this. It seems that nginx is blocking php scripts.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

<form method="POST" action="contact.php">
.
.
</form>

I’m made aware that POST method is not allowed in static html with nginx but I’ve been searching for the right config all over the internet and none of the suggested solution work for me.

@kamaln7

Can you help point me in the right direction? Appreciate it so much. Thanks ;)

Hi! Can you post the HTML source code of the contact form? Specifically the <form ...> line. What method is it using?