Hello,
I have several dockers, including one for seafile and another for nginx. I have a domain name of type “domain-name” and I would like to have a subdomain of type “drive.domain-name”. My nginx config file for “drive.domain-name” is as follows:
`server {
if ($host = drive.nom.domain {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name drive.nom.domain;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://172.17.0.6;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
server {
listen 443 ssl;
listen [::]:443;
server_name drive.nom.domain.***;
ssl_certificate /etc/letsencrypt/live/nom.domain.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/nom.domain.com-0001/privkey.pem; # managed by Certbot
location / {
proxy_set_header Host $http_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-Proto https;
proxy_pass http://172.17.0.6;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
`
Seafile corresponds to my subdomain “drive.nom-de-domaine”
`version: ‘2.0’
services:
db:
image: mariadb:10.1
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=******* # Requested, set the root’s password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- /opt/seafile-mysql/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
networks:
- seafile_seafile-net
- bridge
memcached:
image: memcached:1.5.6
container_name: seafile-memcached
entrypoint: memcached -m 256
networks:
- seafile_seafile-net
- bridge
seafile:
image: seafileltd/seafile-mc:latest
container_name: seafile
ports:
- “80:80”
- “443:443” # If https is enabled, cancel the comment.
volumes:
- /opt/seafile-data:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=****
- DB_ROOT_PASSWD=****** # Requested, the value shuold be root’s password of MySQL service.
- TIME_ZONE=Europe/Paris # Optional, default is UTC. Should be uncomment and set to your local time zone.
- SEAFILE_ADMIN_EMAIL=*********** # Specifies Seafile admin user, default is ‘me@example.com’.
- SEAFILE_ADMIN_PASSWORD=FictisVin49? # Specifies Seafile admin password, default is ‘asecret’.
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME=drive.nom.domain.*** # Specifies your host name if https is enabled.
depends_on:
- db
- memcached
networks:
- seafile_seafile-net
- bridge
networks:
seafile_seafile-net:
bridge: `
The dockers’ configuration data is as follows.
The configuration of my docker seafile is as follows
Here is the list of my networks:
My problem is that when I try to access the seafile service in a browser through “drive.domain-name”, I get the “502 bad gateway” error. Do you have any idea where this problem can come from? And if so, how to fix it. Thanks in advance.
indent preformatted text by 4 spaces