How to change Nginx default ports?

Hi,
I’m starting out fresh with apps on Electric Eel. For my setup ports 80,81 and 443 are already in use elsewhere so I would like to change the default Nginx ports, but can’t see how?
Sorry for the numpty questions, but I’m a caddy user and have never used Nginx before.

The goal is to access Filebrowser from out side the network on this address https://files.mydomain.com:9443
I have installed filebrowser and it works locally, then I installed Nginx and added an SSL cert using cloudflare dns challenge, and that’s where I’m now stuck.

Not properly the answer of your question, but IMHO if you install nginx proxy manager on a dedicated container (with the default ports), you can manage every other container from there without headache.

Use caddy then if you are familiar with it, runs great on Eel.

You could always change Scale to not use 80 and 443, thus allowing you to use those on the same IP. For all other apps that use 80 or 443, you would run them behind the caddy of nginx reverse proxy.

Try a manual install

to change the ports published to the host just change the ports section

2.11.2 I believe this is the correct version for CF dns as the next 2.11.3 had an error

**set the permission on the host paths to 568

networks:
  reverseproxy:
    name: reverseproxy
services:
  nginx-proxy-manager:
    container_name: nginx-proxy-manager
    image: jc21/nginx-proxy-manager:2.11.2
    hostname: nginx-proxy-manager #  user admin@example.com    password   changeme
    user: 0:568
    ports:
      - 80:80 # Public HTTP Port
      - 443:443 # Public HTTPS Port
      - 8081:81 # Admin Web Port
    restart: unless-stopped
    environment:
      PUID: 568
      DB_MYSQL_HOST: mariadb-nginx
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: npm
      DB_MYSQL_PASSWORD: npm
      DB_MYSQL_NAME: npm
      TZ: America/Chicago
    networks:
      - reverseproxy
    depends_on:
      - mariadb-nginx
    volumes:
      - /mnt/pathonhost/nginx-data:/data
      - /mnt/pathonhost/nginx-certs:/etc/letsencrypt
  mariadb-nginx:
    container_name: mariadb-nginx
    image: jc21/mariadb-aria:10.11.5-innodb
    user: 0:568
    expose:
      - 3306
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: npm
      MYSQL_DATABASE: npm
      MYSQL_USER: npm
      MYSQL_PASSWORD: npm
      PUID: 568
      TZ: America/Chicago
    networks:
      - reverseproxy
    volumes:
      - /mnt/pathonhost/mariadb-nginx:/var/lib/mysql

First thanks so much for the help all, I had a very poor understanding of what I was even trying to say here! I’m just doing the RC2 update, then I’ll get back here with some screenshots and hopefully a much better explanation.
Thanks to your contributions progress has been made! :smile:

ok it is actually proxy manager I installed, I have now set my router to forward 9443 to mytruenaslocalip:30022
this seems to work as now when I add a proxy host of http://filebrowser:30051
and go to https://files.mydomain:9443 i end up at a 502 bad gateway error.
Delete the proxy and i go nowhere, add it back and boom 502 again.

Sadly I do not know why I’m getting the 502 error though?


Attach log of the container here

ok that just got alot weirder!!! I added these headers and fixed the 502 error.

location / {
    proxy_redirect off;
    client_max_body_size 0;
    proxy_request_buffering off;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

But now I have this page.

attaching logs
npmlog.txt (7.5 KB)
filebrowserlog.txt (11.8 KB)

Something not well setup on certificate

http: TLS handshake error from 192.168.50.2:57958: remote error: tls: unknown certificate

yeah, even if I use Cloudflare DNS Challenge it still doesnt work though.

Would be good if someone could prove it working, maybe someone else could have a go?

I did find this, which suggests that filebrowser needs a baseurl set.

Filebrowser behind Nginx reverse proxy doesn’t work · Issue #400 · filebrowser/filebrowser · GitHub