NginxProxyManager / nginx-proxy-manager

Docker container for managing Nginx proxy hosts with a simple, powerful interface
https://nginxproxymanager.com
MIT License
22.14k stars 2.55k forks source link

Add ability to configure "worker_processes" #2388

Open PingTrip opened 1 year ago

PingTrip commented 1 year ago

Is your feature request related to a problem? Please describe. For a home network/low traffic deployment the current setting of worker_processes auto; is overkill since it spawns an nginx process for every core.

Describe the solution you'd like Provide a mechanism to override the current hard-coded "auto" setting.

Describe alternatives you've considered I tried overriding the parameter via /data/nginx/custom/root.conf which resulted in an Nginx error: nginx: [emerg] "worker_processes" directive is duplicate in /data/nginx/custom/root.conf:1.

k4my4b commented 1 year ago

Exact same issue here. An environment variable like WORKER_PROCESSES would suffice. But while we're at it can we please add environment variables for thread pools as well, thanks!

fevernova90 commented 1 year ago

Bump up!

Using this in production of a small growing app. There's no direct way to override worker_connections. 1024 is surely not enough.

CreeperFace00 commented 1 year ago

Having this issue as well, would love to see this implemented!

msycn commented 10 months ago

same here please help us to change worker_connections

kroese commented 10 months ago

@msycn That is already possible thanks to the commit @Blooym made. Just put that line in /data/nginx/custom/events.conf and it will work just fine.

msycn commented 10 months ago

@msycn That is already possible thanks to the commit @Blooym made. Just put that line in and it will work just fine./data/nginx/custom/events.conf

Wow ,you are my hero ! Thanks for your quick reply!!!

redtripleAAA commented 6 months ago

@kroese getting the same issue, as reported here:

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

Any idea what is that line for? /data/nginx/custom/events.conf

Do we add it as env in the docker compose? or is it something else?

kroese commented 6 months ago

@ansred It is a file that you can edit. So if you create that file, and put worker_processes 1; inside it it will work.

redtripleAAA commented 6 months ago

@kroese Here is my docker compose

version: "3"

services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: Nginx_Proxy_Manager_SQLite
    restart: always
    ports:
      - '80:80'        # Public HTTP Port:
      - '443:443'      # Public HTTPS Port:
      - '81:81'        # Admin Web Port:
    environment:
        DB_SQLITE_FILE: "/data/database.sqlite"
        DISABLE_IPV6: 'true'

    volumes:
      - /volume1/docker/containers/npm/config/data:/data
      - /volume1/docker/containers/npm/config/cert:/etc/letsencrypt

I assume, in /docker/containers/npm/config/data/nginx just create the directory /custom and file /events.conf

Like this:

root@ds1520:/volume1/docker/containers/npm/config/data/nginx/custom# pwd
/volume1/docker/containers/npm/config/data/nginx/custom
root@ds1520:/volume1/docker/containers/npm/config/data/nginx/custom# cat events.conf
worker_processes 1;

And no other mapping required and things should work?

TomErnst1972 commented 2 weeks ago

that former work around doesnt seem to work any longer. Any other ideas?

❯ Starting nginx ...
nginx: [emerg] "worker_processes" directive is not allowed here in /data/nginx/custom/events.conf:1