Question - How-to - Change default listening ports 80 and 443

Greetings

Question about nginx image

I have the following stack running without issues

---
version: "2.1"
services:
  nginx:
    image: ghcr.io/linuxserver/nginx
    container_name: nginx-test
    environment:
      - PUID=1029
      - PGID=100
      - TZ=America/Toronto
    volumes:
      - /volume1/docker/Bootstrap/test:/config
    ports:
      - 8011:80
      - 8012:443
    restart: unless-stopped

I wonder what/where should I change the default listening ports 80 and 443 ?

Setup:
Synology DSM
Docker Compose via Portainer

I tried changing the port from here, but that didn’t work

I figured out the issue.

You need to change both the docker compose stack + nginx config value to the same

1) Stack Compose

---
version: "2.1"
services:
  nginx:
    image: ghcr.io/linuxserver/nginx
    container_name: nginx-test
    environment:
      - PUID=1029
      - PGID=100
      - TZ=America/Toronto
    volumes:
      - /volume1/docker/Bootstrap/test:/config
    ports:
      - 8011:8011
      - 8012:8012
    restart: unless-stopped

2) nginx config

/nginx/site-confs/default

There is no need to change the ports inside the container. You already mapped 80 and 443 to 8011 and 8012 on the host in the compose.

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