Olá gente, sou meio iniciante no mundo de servers e linux. Contratei uma vps no hostinger para fazer selfhost de apps. Estou tendando fazer a config do Nginx (primeira vez que uso) com o Nextcloud AIO, mas ambos dentro de containers dockers.
Por algum motivo o nginx não enxerga de jeito nenhum o Nexcloud AIO. Já tentei varia configs diferentes.
No moment meu setup esta assim:
/srv
├─ nginx
│ ├─ compose.yaml
│ ├─ nginx.conf
│ ├─ conf.d/
│ │ ├─ 00-http.conf
│ │ └─ nextcloud.conf
│ ├─ certbot/
│ │ └─ compose.yaml
│ ├─ certs/
│ └─ acme/
└─ nextcloud
└─ compose.yaml
nginx/compose.yaml
services:
nginx:
image: nginx:1.25
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./conf.d:/etc/nginx/conf.d:ro
- ./certs:/etc/nginx/certs
- ./acme:/var/www/certbot
networks:
- proxy
networks:
proxy:
external: true
nginx/nginx.conf
user nginx;
worker_processes auto;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
include /etc/nginx/conf.d/*.conf;
}
nginx/conf.d/00-http.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
nginx/conf.d/nextcloud.conf
server {
listen 443 ssl http2;
server_name cloud.srv.maiahub.com.br;
ssl_certificate /etc/nginx/certs/live/cloud.srv.maiah>
ssl_certificate_key /etc/nginx/certs/live/cloud.srv.maiah>
client_max_body_size 10G;
location / {
proxy_pass http://nextcloud-aio-mastercontainer:11000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forward>
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
nginx/certbot/compose.yaml
version: "3.9"
services:
certbot:
image: certbot/certbot
volumes:
- ../certs:/etc/letsencrypt
- ../acme:/var/www/certbot
nextcloud/compose.yaml
services:
nextcloud-aio-mastercontainer:
image: nextcloud/all-in-one:latest
container_name: nextcloud-aio-mastercontainer
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- APACHE_PORT=11000
- APACHE_IP_BINDING=0.0.0.0
- APACHE_ADDITIONAL_NETWORK=proxy
networks:
- proxy
volumes:
nextcloud_aio_mastercontainer:
name: nextcloud_aio_mastercontainer
networks:
proxy:
external: true
Infos do systema
System:
Kernel: 6.8.0-90-generic arch: x86_64 bits: 64
Console: pty pts/0 Distro: Ubuntu 24.04.3 LTS (Noble Numbat)
Machine:
Type: Kvm System: QEMU product: Standard PC (i440FX + PIIX, 1996) v: pc-i440fx-9.2
serial: <superuser required>
Mobo: N/A model: N/A serial: N/A BIOS: SeaBIOS v: rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org
date: 04/01/2014
CPU:
Info: dual core model: AMD EPYC 9354P bits: 64 type: MCP cache: L2: 1024 KiB
Speed (MHz): avg: 3250 min/max: N/A cores: 1: 3250 2: 3250
Graphics:
Message: No PCI device data found.
Display: server: No display server data found. Headless machine? tty: 116x55
API: EGL v: 1.5 drivers: swrast platforms: surfaceless,device
API: OpenGL v: 4.5 vendor: mesa v: 25.0.7-0ubuntu0.24.04.2 note: console (EGL sourced)
renderer: llvmpipe (LLVM 20.1.2 256 bits)
Audio:
Message: No device data found.
Network:
Device-1: Intel 82371AB/EB/MB PIIX4 ACPI type: network bridge driver: N/A
Device-2: Red Hat Virtio network driver: virtio-pci
IF: eth0 state: up speed: -1 duplex: unknown mac: <filter>
IF-ID-1: br-4658dd9120c5 state: down mac: <filter>
IF-ID-2: br-bbcff157ffce state: up speed: 10000 Mbps duplex: unknown mac: <filter>
IF-ID-3: br-f24782a42c2d state: up speed: 10000 Mbps duplex: unknown mac: <filter>
IF-ID-4: docker0 state: down mac: <filter>
IF-ID-5: veth00a4bab state: up speed: 10000 Mbps duplex: full mac: <filter>
IF-ID-6: veth049377c state: up speed: 10000 Mbps duplex: full mac: <filter>
IF-ID-7: veth674da13 state: up speed: 10000 Mbps duplex: full mac: <filter>
IF-ID-8: veth8a184d9 state: up speed: 10000 Mbps duplex: full mac: <filter>
IF-ID-9: vethd535b5c state: up speed: 10000 Mbps duplex: full mac: <filter>
Drives:
Local Storage: total: 100 GiB used: 4.28 GiB (4.3%)
ID-1: /dev/sda vendor: QEMU model: HARDDISK size: 100 GiB
Partition:
ID-1: / size: 95.82 GiB used: 4.21 GiB (4.4%) fs: ext4 dev: /dev/sda1
ID-2: /boot size: 880.4 MiB used: 65.7 MiB (7.5%) fs: ext4 dev: /dev/sda16
ID-3: /boot/efi size: 104.3 MiB used: 6.1 MiB (5.9%) fs: vfat dev: /dev/sda15
Swap:
Alert: No swap data was found.
Sensors:
Src: lm-sensors+/sys Message: No sensor data found using /sys/class/hwmon or lm-sensors.
Info:
Memory: total: 8 GiB available: 7.75 GiB used: 808 MiB (10.2%)
Processes: 142 Uptime: 3d 20h 27m Init: systemd target: graphical (5) Shell: Bash inxi: 3.3.34
A ideia é deixar o nginx funcinando para no futuro eu fazer host de outros apps como bitwarden e etc, e ele ser o ponto de entrada unico da minha vps. Mas gostaria de começar com o Nextcloud AIO.
Se alguem puder me ajudar eu ficaria muito feliz.