Add nginx server
This commit is contained in:
parent
f214d4f4c1
commit
c4437e3639
4 changed files with 45 additions and 0 deletions
|
@ -33,6 +33,26 @@ services:
|
|||
- "traefik.port=8008"
|
||||
- "traefik.docker.network=proxy"
|
||||
|
||||
well-kwown:
|
||||
image: nginx:latest
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- internal
|
||||
- proxy
|
||||
volumes:
|
||||
- ./nginx/matrix.conf:/etc/nginx/conf.d/matrix.conf
|
||||
- ./nginx/www:/var/www/
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowOriginList=*"
|
||||
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowHeaders=Origin, X-Requested-With, Content-Type, Accept, Authorization"
|
||||
- "traefik.http.middlewares.cors-headers.headers.accessControlAllowMethods=GET, POST, PUT, DELETE, OPTIONS"
|
||||
- "traefik.http.routers.matrix-wellknown.rule=Host(`matrix.mrdev023.fr`) && PathPrefix(`/.well-known/matrix`)"
|
||||
- "traefik.http.routers.matrix-wellknown.tls=true"
|
||||
- "traefik.http.routers.matrix-wellknown.tls.certresolver=sslResolver"
|
||||
- "traefik.http.routers.matrix-wellknown.middlewares=cors-headers@docker"
|
||||
- "traefik.docker.network=proxy"
|
||||
|
||||
|
||||
volumes:
|
||||
db:
|
||||
|
|
17
matrix/nginx/matrix.conf
Normal file
17
matrix/nginx/matrix.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
server {
|
||||
listen 80 default_server;
|
||||
server_name matrix.mrdev023.fr;
|
||||
|
||||
# Traefik -> nginx -> synapse
|
||||
location /_matrix {
|
||||
proxy_pass http://synapse:8008;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
client_max_body_size 128m;
|
||||
}
|
||||
|
||||
location /.well-known/matrix/ {
|
||||
root /var/www/;
|
||||
default_type application/json;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
}
|
||||
}
|
5
matrix/nginx/www/.well-known/matrix/client
Normal file
5
matrix/nginx/www/.well-known/matrix/client
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"m.homeserver": {
|
||||
"base_url": "https://matrix.mrdev023.fr"
|
||||
}
|
||||
}
|
3
matrix/nginx/www/.well-known/matrix/server
Normal file
3
matrix/nginx/www/.well-known/matrix/server
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"m.server": "matrix.mrdev023.fr:443"
|
||||
}
|
Loading…
Reference in a new issue