Cloudways Deployment: 403 Forbidden on npx frontity serve

Hello everyone! Thanks in advance to anyone who can shine some light on this issue I’m currently facing.
After deployment of my project from git and running the proper commands, everything builds properly, but the problem comes when it’s time to serve. Using npx frontity serve definitely starts the server, but on the browser there is a 403 Forbidden which you can see here at this development URL:

I’m wondering, is there anything specifically that I need to do regarding deployment on Cloudways? I know there is no htaccess at the root, does this need to happen? If so, how is that done?

Thank you so much.

P.S. - here is a link to my public repo if that helps: GitHub - Marcquito/frontity-test: Testing a basic Frontity theme.

By default port 80 is used for Apache/nginx, and Frontity used port 3000 by default.

So when you run npx frontity server you should be able to access it on port 3000.

To make it work you could either use the Frontity Embedded Mode plugin in WordPress (same server), and simply point that to port 3000.

Or you’ll need to setup apache/nginx as a proxy.

Thanks for the reply! If I can’t currently access the site when the server is running at this location: does that pose a different issue?

So I made another discovery during this journey - turns out port 3000 on Cloudways is not open for inbound traffic. Just for historical purposes, here is my chat log with support:

events.js:292 throw er; // Unhandled ‘error’ event ^ Error: listen EADDRINUSE: address already in use :::3000 at Server.setupListenHandle [as _listen2] (net.js:1318:16) at listenInCluster (net.js:1366:12)

Please configure the application to listen to port 80/443 instead of 3000

The port 3000 is not open for inbound traffic. We can can it from port 80 and then internally redirect to port 3000 which I have already set up for you

All you need to do is make app run on port 80 instead of 3000

So I’m currently researching how to do this, but if anyone has any experience telling Frontity to run on port 80, I’m all ears! Thanks in advance!

Hi @marc

The frontity serve command allows you choose the port with the --port option

Hope this helps

And make sure that Apache/nginx are not running on port 80/443, otherwise they’ll conflict with each other. Unless, as suggested before, you use them as a proxy to your Frontity server.

1 Like