++ Add nginx
This commit is contained in:
6
.env
6
.env
@@ -3,10 +3,10 @@ TZ=Europe/Rome
|
|||||||
NEXTCLOUD_DOMAIN=drive.pyconetwork.it
|
NEXTCLOUD_DOMAIN=drive.pyconetwork.it
|
||||||
NEXTCLOUD_DOMAIN_REGEX=drive\\.pyconetwork\\.it
|
NEXTCLOUD_DOMAIN_REGEX=drive\\.pyconetwork\\.it
|
||||||
TRUSTED_PROXY_IP=192.168.4.4
|
TRUSTED_PROXY_IP=192.168.4.4
|
||||||
|
TRUSTED_PROXIES=192.168.4.4 172.30.0.10
|
||||||
|
|
||||||
# Porte pubblicate sul nodo Docker: il reverse proxy punta qui.
|
# Unica porta pubblicata sul nodo Docker: il reverse proxy punta a nginx.
|
||||||
NEXTCLOUD_PORT=8282
|
NGINX_PORT=8383
|
||||||
COLLABORA_PORT=9980
|
|
||||||
|
|
||||||
MYSQL_DATABASE=nextcloud
|
MYSQL_DATABASE=nextcloud
|
||||||
MYSQL_USER=nextcloud
|
MYSQL_USER=nextcloud
|
||||||
|
|||||||
@@ -1,4 +1,19 @@
|
|||||||
services:
|
services:
|
||||||
|
nginx:
|
||||||
|
image: nginx:1.27-alpine
|
||||||
|
container_name: nextcloud-nginx
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
|
- collabora
|
||||||
|
ports:
|
||||||
|
- "${NGINX_PORT}:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
|
networks:
|
||||||
|
nextcloud_internal:
|
||||||
|
ipv4_address: 172.30.0.10
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: mariadb:11.4
|
image: mariadb:11.4
|
||||||
container_name: nextcloud-db
|
container_name: nextcloud-db
|
||||||
@@ -30,8 +45,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- redis
|
- redis
|
||||||
ports:
|
expose:
|
||||||
- "${NEXTCLOUD_PORT}:80"
|
- "80"
|
||||||
environment:
|
environment:
|
||||||
MYSQL_HOST: db
|
MYSQL_HOST: db
|
||||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||||
@@ -40,7 +55,7 @@ services:
|
|||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
REDIS_HOST_PASSWORD: ${REDIS_PASSWORD}
|
REDIS_HOST_PASSWORD: ${REDIS_PASSWORD}
|
||||||
NEXTCLOUD_TRUSTED_DOMAINS: ${NEXTCLOUD_DOMAIN}
|
NEXTCLOUD_TRUSTED_DOMAINS: ${NEXTCLOUD_DOMAIN}
|
||||||
TRUSTED_PROXIES: ${TRUSTED_PROXY_IP}
|
TRUSTED_PROXIES: ${TRUSTED_PROXIES}
|
||||||
OVERWRITEHOST: ${NEXTCLOUD_DOMAIN}
|
OVERWRITEHOST: ${NEXTCLOUD_DOMAIN}
|
||||||
OVERWRITEPROTOCOL: https
|
OVERWRITEPROTOCOL: https
|
||||||
OVERWRITECLIURL: https://${NEXTCLOUD_DOMAIN}
|
OVERWRITECLIURL: https://${NEXTCLOUD_DOMAIN}
|
||||||
@@ -56,8 +71,8 @@ services:
|
|||||||
image: collabora/code:latest
|
image: collabora/code:latest
|
||||||
container_name: collabora
|
container_name: collabora
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
expose:
|
||||||
- "${COLLABORA_PORT}:9980"
|
- "9980"
|
||||||
environment:
|
environment:
|
||||||
domain: ${NEXTCLOUD_DOMAIN_REGEX}
|
domain: ${NEXTCLOUD_DOMAIN_REGEX}
|
||||||
username: ${COLLABORA_USERNAME}
|
username: ${COLLABORA_USERNAME}
|
||||||
@@ -77,3 +92,6 @@ volumes:
|
|||||||
networks:
|
networks:
|
||||||
nextcloud_internal:
|
nextcloud_internal:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 172.30.0.0/24
|
||||||
|
|||||||
79
nginx/default.conf
Normal file
79
nginx/default.conf
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
upstream nextcloud_upstream {
|
||||||
|
server app:80;
|
||||||
|
}
|
||||||
|
|
||||||
|
upstream collabora_upstream {
|
||||||
|
server collabora:9980;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
client_max_body_size 20G;
|
||||||
|
proxy_read_timeout 3600;
|
||||||
|
proxy_connect_timeout 3600;
|
||||||
|
proxy_send_timeout 3600;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://nextcloud_upstream;
|
||||||
|
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_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ^~ /cool {
|
||||||
|
proxy_pass http://collabora_upstream;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
}
|
||||||
|
|
||||||
|
location ^~ /hosting/discovery {
|
||||||
|
proxy_pass http://collabora_upstream;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ^~ /loleaflet {
|
||||||
|
proxy_pass http://collabora_upstream;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ^~ /browser {
|
||||||
|
proxy_pass http://collabora_upstream;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ^~ /ws {
|
||||||
|
proxy_pass http://collabora_upstream;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto https;
|
||||||
|
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user