Question

Running both PHP and Node.js on Nginx on the same server

Is it possible to run both PHP and Node.js application on the same server with Nginx? I use nginx as reverse proxy for node.js while on PHP I use nginx as substitute for Apache web server.


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.

Check this Gist… it works for me ;)

Practically you can copy and paste, just need to update the routes.

https://gist.github.com/yacafx/a730903e8ec69063c18394e4752b6657

Hope this works for you!

Hey, I got error like this Starting nginx: nginx: [emerg] duplicate listen options for [::]:80 in /var/www/hosts/librarian.conf:32

Thanks! But I already figured it out 2 days ago. :)