I understand this requires configuring Nginx as a reverse proxy to forward requests from /api to localhost:9000, but I’m not sure how to properly configure this with my existing Nginx + Apache2 setup.
I attempted to create a custom web template for my Node.js application by creating .tpl and .stpl files in /usr/local/hestia/data/templates/web/nginx/, but when I try to apply the template using:
bash
v-change-web-domain-tpl user domain.com nodejs-template
I get the error: “nodejs-template web template doesn’t exist” even though the files are present with correct permissions.
Questions:
How should I configure the Nginx location block for /api requests?
Will this interfere with my existing Apache2 configuration?
Should I handle this at the Nginx level or Apache2 level?
Any security considerations I should be aware of?
Environment:
Operating System: Linux
Web Server: Nginx + Apache2
Application: Node.js (Express)
Control Panel: HestiaCP (if relevant)
Any guidance or configuration examples would be greatly appreciated! I want to ensure I’m following best practices for security and performance.
This is great that you solved your own problem! My solution would’ve been to actually use Cloudflare Tunnels. That instead of worrying about all this, you can just install Cloudflare Tunnel on your server and then configure the hostname using Cloudflare zero trust dashboard and without opening the port.
Thank you so much for the tip. The bigger issue is that all my DNS records are tied to government entities, so switching to Cloudflare would be a bit messy—I depend not only on third parties but also on the government, lol.
But thank you anyway. I’m sure your approach is much simpler, and I’m certain our thread will help a lot of people who are dealing with this headache, lol.
oh! Govt Yes - I hear you man!
I completely agree, your solution is definitely more useful when one can’t depend on third party solutions like Cloudflare.