nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Allow for custom nginx configuration for streams in WebUI

Open bluekitedreamer opened this issue 1 year ago • 8 comments

Is your feature request related to a problem? Please describe.

NPM streams does not have an 'advanced' tab for custom nginx configuration similar to nginx proxies. There are some use cases where this would be handy. See here:

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3619

Describe the solution you'd like

Allow for nginx custom configuration on streams through the WebUI

Describe alternatives you've considered

Manually editing the files which could break NPM's relationship to the configuration file based upon the stream template https://github.com/NginxProxyManager/nginx-proxy-manager/blob/d40f9e06fc25acbf6906663edcef462a1a902cdf/backend/templates/stream.conf

EDIT: I just found the advanced documentation which says to do what I mentioned above, and this will technically allow for custom configs to not break NPM's generation of configs

Additional context

https://github.com/NginxProxyManager/nginx-proxy-manager/issues/3619

bluekitedreamer avatar Mar 13 '24 12:03 bluekitedreamer

Currently this is being handled by importing custom streams from a seperate folder as designated by the nginx.conf templates.

https://github.com/NginxProxyManager/nginx-proxy-manager/blob/d40f9e06fc25acbf6906663edcef462a1a902cdf/docs/advanced-config/README.md?plain=1

# run nginx in foreground
daemon off;
pid /run/nginx/nginx.pid;
user npm;

# Set number of worker processes automatically based on number of CPU cores.
worker_processes auto;

# Enables the use of JIT for regular expressions to speed-up their processing.
pcre_jit on;

error_log /data/logs/fallback_error.log warn;

# Includes files with directives to load dynamic modules.
include /etc/nginx/modules/*.conf;

events {
	include /data/nginx/custom/events[.]conf;
}

http {
	include                       /etc/nginx/mime.types;
	default_type                  application/octet-stream;
	sendfile                      on;
	server_tokens                 off;
	tcp_nopush                    on;
	tcp_nodelay                   on;
	client_body_temp_path         /tmp/nginx/body 1 2;
	keepalive_timeout             90s;
	proxy_connect_timeout         90s;
	proxy_send_timeout            90s;
	proxy_read_timeout            90s;
	ssl_prefer_server_ciphers     on;
	gzip                          on;
	proxy_ignore_client_abort     off;
	client_max_body_size          2000m;
	server_names_hash_bucket_size 1024;
	proxy_http_version            1.1;
	proxy_set_header              X-Forwarded-Scheme $scheme;
	proxy_set_header              X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header              Accept-Encoding "";
	proxy_cache                   off;
	proxy_cache_path              /var/lib/nginx/cache/public  levels=1:2 keys_zone=public-cache:30m max_size=192m;
	proxy_cache_path              /var/lib/nginx/cache/private levels=1:2 keys_zone=private-cache:5m max_size=1024m;

	log_format proxy '[$time_local] $upstream_cache_status $upstream_status $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] [Sent-to $server] "$http_user_agent" "$http_referer"';
	log_format standard '[$time_local] $status - $request_method $scheme $host "$request_uri" [Client $remote_addr] [Length $body_bytes_sent] [Gzip $gzip_ratio] "$http_user_agent" "$http_referer"';

	access_log /data/logs/fallback_access.log proxy;

	# Dynamically generated resolvers file
	include /etc/nginx/conf.d/include/resolvers.conf;

	# Default upstream scheme
	map $host $forward_scheme {
		default http;
	}

	# Real IP Determination

	# Local subnets:
	set_real_ip_from 10.0.0.0/8;
	set_real_ip_from 172.16.0.0/12; # Includes Docker subnet
	set_real_ip_from 192.168.0.0/16;
	# NPM generated CDN ip ranges:
	include conf.d/include/ip_ranges.conf;
	# always put the following 2 lines after ip subnets:
	real_ip_header X-Real-IP;
	real_ip_recursive on;

	# Custom
	include /data/nginx/custom/http_top[.]conf;

	# Files generated by NPM
	include /etc/nginx/conf.d/*.conf;
	include /data/nginx/default_host/*.conf;
	include /data/nginx/proxy_host/*.conf;
	include /data/nginx/redirection_host/*.conf;
	include /data/nginx/dead_host/*.conf;
	include /data/nginx/temp/*.conf;

	# Custom
	include /data/nginx/custom/http[.]conf;
}

stream {
	# Files generated by NPM
	include /data/nginx/stream/*.conf;

	# Custom
	include /data/nginx/custom/stream[.]conf;
}

# Custom
include /data/nginx/custom/root[.]conf;

bluekitedreamer avatar Mar 13 '24 12:03 bluekitedreamer

bumping

pgabrys94 avatar Mar 21 '24 20:03 pgabrys94

Issue is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Oct 27 '24 02:10 github-actions[bot]

Bump

jeffshead avatar Dec 06 '24 22:12 jeffshead

so what is going on with the streams, how can I get it going?

tp1050 avatar Jan 23 '25 14:01 tp1050

+1

TheNkl avatar May 24 '25 13:05 TheNkl

Issue is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Nov 26 '25 02:11 github-actions[bot]

want it still

TheNkl avatar Nov 26 '25 08:11 TheNkl