Code Monkey home page Code Monkey logo

Comments (5)

thefurrycanadian avatar thefurrycanadian commented on June 15, 2024

I am also getting the same error backwards, where the Port will not write. This is the latest one using my main CP page

[emerg] invalid port in "[Local IP Address]:" of the "listen" directive in /etc/nginx/conf.d/domains/server.[Website Name].ssl.conf:8

And here is Line 8:

listen      [My Internal IP]: ssl;

There is no port written

from hestiacp.

jaapmarcus avatar jaapmarcus commented on June 15, 2024

There must be something wrong with your server config..

from hestiacp.

tlcd96 avatar tlcd96 commented on June 15, 2024

There must be something wrong with your server config..

It's missing the port for https, that is: 443.

If you've made a new template, please send the template via this issue. I'll do my best, or another member of the contributors of HestiaCP) to see where the error is.

then templates must include [IP]:[PORT], see bellow the two options:

SSL HTTP (ssl.conf):

#=======================================================================#
# Default Web Domain Template                                           #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
#=======================================================================#

server {
    listen      172.16.10.1:443 ssl;
    server_name [redacted] ;

Normal Http (.conf):

#=======================================================================#
# Default Web Domain Template                                           #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
#=======================================================================#

server {
    listen      172.16.10.1:80;
    server_name [redacted] ;

from hestiacp.

thefurrycanadian avatar thefurrycanadian commented on June 15, 2024

Hi, yes it is missing the port. the %web_port% and sometimes the %ip% port of the configuration file do not load. It will be random, but I do find a trend it is normally on the host url config as well as the domain last created. I am going to re download the default configs and see if that helps, but I havent touched them (other then to duplicate them using winscp to make new ones)

from hestiacp.

thefurrycanadian avatar thefurrycanadian commented on June 15, 2024

The newest one didnt add my IP address... here is the domain.conf:

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

server {
	listen      :80;
	server_name [Domain]  www.[Domain];
	root        /home/[User]/web/[Domain]/public_html;
	index       index.php index.html index.htm;
	access_log  /var/log/nginx/domains/[Domain].log combined;
	access_log  /var/log/nginx/domains/[Domain].bytes bytes;
	error_log   /var/log/nginx/domains/[Domain].error.log error;

	include /home/[User]/conf/web/[Domain]/nginx.forcessl.conf*;

	location ~ /\.(?!well-known\/) {
		deny all;
		return 404;
	}

	location / {
		location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ {
			expires max;
			fastcgi_hide_header "Set-Cookie";
		}

		location ~ [^/]\.php(/|$) {
			try_files $uri =404;

			include /etc/nginx/fastcgi_params;

			fastcgi_index index.php;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

			fastcgi_pass unix:/run/php/php8.3-fpm-brandonz.ca.sock;

			include /home/[User]/conf/web/[Domain]/nginx.fastcgi_cache.conf*;
		}
	}

	location /error/ {
		alias /home/TheFurryCanadian/web/brandonz.ca/document_errors/;
	}

	location /vstats/ {
		alias   /home/[User]/web/[Domain]/stats/;
		include /home/[User]/web/[Domain]/stats/auth.conf*;
	}

	include /etc/nginx/conf.d/phpmyadmin.inc*;
	include /etc/nginx/conf.d/phppgadmin.inc*;
	include /home/[User]/conf/web/[Domain]/nginx.conf_*;
}

my domain.ssl.conf

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

server {
	listen      :443 ssl;
	server_name [Domain] www.[Domain];
	root        /home/[User]/web/[Domain]/public_html;
	index       index.php index.html index.htm;
	access_log  /var/log/nginx/domains/[Domain].log combined;
	access_log  /var/log/nginx/domains/[Domain].bytes bytes;
	error_log   /var/log/nginx/domains/[Domain].error.log error;

	ssl_certificate     /home/[User]/conf/web/[Domain]/ssl/[Domain].pem;
	ssl_certificate_key /home/[User]/conf/web/[Domain]/ssl/[Domain].key;
	ssl_stapling        on;
	ssl_stapling_verify on;

	# TLS 1.3 0-RTT anti-replay
	if ($anti_replay = 307) { return 307 https://$host$request_uri; }
	if ($anti_replay = 425) { return 425; }

	include /home/[User]/conf/web/[Domain]/nginx.hsts.conf*;

	location ~ /\.(?!well-known\/) {
		deny all;
		return 404;
	}

	location / {
		location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ {
			expires max;
			fastcgi_hide_header "Set-Cookie";
		}

		location ~ [^/]\.php(/|$) {
			try_files $uri =404;

			include /etc/nginx/fastcgi_params;

			fastcgi_index index.php;
			fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

			fastcgi_pass unix:/run/php/php8.3-fpm-[Domain].sock;

			include /home/[User]/conf/web/[Domain]/nginx.fastcgi_cache.conf*;
		}
	}

	location /error/ {
		alias /home/[User]/web/[Domain]/document_errors/;
	}

	location /vstats/ {
		alias   /home/[User]/web/[Domain]/stats/;
		include /home/[User]/web/[Domain]/stats/auth.conf*;
	}

	proxy_hide_header Upgrade;

	include /etc/nginx/conf.d/phpmyadmin.inc*;
	include /etc/nginx/conf.d/phppgadmin.inc*;
	include /home/[User]/conf/web/[Domain]/nginx.ssl.conf_*;
}

My templates are default but for good measure here they are, starting with default.tpl

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

server {
	listen      %ip%:%web_port%;
	server_name %domain_idn% %alias_idn%;
	root        %docroot%;
	index       index.php index.html index.htm;
	access_log  /var/log/nginx/domains/%domain%.log combined;
	access_log  /var/log/nginx/domains/%domain%.bytes bytes;
	error_log   /var/log/nginx/domains/%domain%.error.log error;

	include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;

	location ~ /\.(?!well-known\/) {
		deny all;
		return 404;
	}

	location / {
		location ~* ^.+\.(jpeg|jpg|png|webp|gif|bmp|ico|svg|css|js)$ {
			expires max;
			fastcgi_hide_header "Set-Cookie";
		}

		location ~ [^/]\.php(/|$) {
			try_files $uri =404;

			include /etc/nginx/fastcgi_params;

			fastcgi_index index.php;
			fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

			fastcgi_pass %backend_lsnr%;

			include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
		}
	}

	location /error/ {
		alias %home%/%user%/web/%domain%/document_errors/;
	}

	location /vstats/ {
		alias   %home%/%user%/web/%domain%/stats/;
		include %home%/%user%/web/%domain%/stats/auth.conf*;
	}

	include /etc/nginx/conf.d/phpmyadmin.inc*;
	include /etc/nginx/conf.d/phppgadmin.inc*;
	include %home%/%user%/conf/web/%domain%/nginx.conf_*;
}

and default.stpl

#=========================================================================#
# Default Web Domain Template                                             #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS   #
# https://hestiacp.com/docs/server-administration/web-templates.html      #
#=========================================================================#

server {
	listen      %ip%:%web_ssl_port% ssl;
	server_name %domain_idn% %alias_idn%;
	root        %sdocroot%;
	index       index.php index.html index.htm;
	access_log  /var/log/nginx/domains/%domain%.log combined;
	access_log  /var/log/nginx/domains/%domain%.bytes bytes;
	error_log   /var/log/nginx/domains/%domain%.error.log error;

	ssl_certificate     %ssl_pem%;
	ssl_certificate_key %ssl_key%;
	ssl_stapling        on;
	ssl_stapling_verify on;
	ssl_session_timeout 1d;
	add_header Strict-Transport-Security max-age=15768000;

	# TLS 1.3 0-RTT anti-replay
	if ($anti_replay = 307) { return 307 https://$host$request_uri; }
	if ($anti_replay = 425) { return 425; }

	include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;

	location ~ /\.(?!well-known\/) {
		deny all;
		return 404;
	}

	location / {
		auth_basic              "Restricted";
		auth_basic_user_file    /home/TheFurryCanadian/web/download.brandonz.ca/download.htpasswd;
		proxy_set_header X-Deluge-Base   "/";
		proxy_pass http://127.0.0.1:8112;
	}

	location /error/ {
		alias %home%/%user%/web/%domain%/document_errors/;
	}

	location /vstats/ {
		alias   %home%/%user%/web/%domain%/stats/;
		include %home%/%user%/web/%domain%/stats/auth.conf*;
	}

	proxy_hide_header Upgrade;

	include /etc/nginx/conf.d/phpmyadmin.inc*;
	include /etc/nginx/conf.d/phppgadmin.inc*;
	include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;

}

from hestiacp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.