%proxy_port% of NodeJS.stpl always result blank

%proxy_port% of NodeJS.stpl always result blank after rebuild from the data/templates into /etc/nginx/conf.d/domains/

  1. I’m using cloudflare
  2. I’ve added the 3000 port to iptable
  3. I’m using nginx+php-fpm

Template Stpl:

server {
    listen %ip%:%proxy_port%;
    server_name %domain_idn% %alias_idn%;
    return 301 https://%domain_idn%$request_uri;
}

server {
    listen %ip%:%proxy_ssl_port% http2 ssl;
    server_name %domain_idn% %alias_idn%;

Result:

server {
    listen 11.1.1.111:;
    server_name test.test.com ;
    return 301 https://test.test.com$request_uri;
}

server {
    listen 11.1.1.111: ssl;
    server_name test.test.com ;

Are you using Nginx or Nginx+Apache?

If you are using only Nginx then %proxy_port% is not the right parameter, the right one is %web_port%

The same for %proxy_ssl_port%, the righ parameter is %web_ssl_port%

Also, http2 directive should be removed from the listen line, http2 is already activated by /etc/nginx/conf.d/http2-directive.conf.

1 Like

Is the %nginx_port% be same, %web_port%?

location / {
        proxy_pass http://127.0.0.1:%nginx_port%;

Hestia doesn’t use %nginx_port% so I suppose it is used by the app/plugin you are using to configure nodejs in Hestia. It should be replaced by the right port you are using in your app (usually 3000 by default) but as I said, maybe that plugin/template is already replacing that option with the right port.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.