mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-16 23:39:54 +03:00
Configured an nginx container acting as a reverse proxy for the mercure container
This commit is contained in:
parent
45db4c321a
commit
4917e53acd
3 changed files with 34 additions and 3 deletions
|
@ -5,8 +5,8 @@ declare(strict_types=1);
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'mercure' => [
|
'mercure' => [
|
||||||
'public_hub_url' => 'http://localhost:3080',
|
'public_hub_url' => 'http://localhost:8001',
|
||||||
'internal_hub_url' => 'http://shlink_mercure',
|
'internal_hub_url' => 'http://shlink_mercure_proxy',
|
||||||
'jwt_secret' => 'mercure_jwt_key',
|
'jwt_secret' => 'mercure_jwt_key',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
17
data/infra/mercure_proxy_vhost.conf
Normal file
17
data/infra/mercure_proxy_vhost.conf
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
|
||||||
|
error_log /home/shlink/www/data/infra/nginx/mercure_proxy.error.log;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://shlink_mercure;
|
||||||
|
proxy_read_timeout 24h;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
|
||||||
|
## Be sure to set USE_FORWARDED_HEADERS=1 to allow the hub to use those headers ##
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ version: '3'
|
||||||
services:
|
services:
|
||||||
shlink_nginx:
|
shlink_nginx:
|
||||||
container_name: shlink_nginx
|
container_name: shlink_nginx
|
||||||
image: nginx:1.17.6-alpine
|
image: nginx:1.17.10-alpine
|
||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "8000:80"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -28,6 +28,7 @@ services:
|
||||||
- shlink_db_ms
|
- shlink_db_ms
|
||||||
- shlink_redis
|
- shlink_redis
|
||||||
- shlink_mercure
|
- shlink_mercure
|
||||||
|
- shlink_mercure_proxy
|
||||||
environment:
|
environment:
|
||||||
LC_ALL: C
|
LC_ALL: C
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ services:
|
||||||
- shlink_db_ms
|
- shlink_db_ms
|
||||||
- shlink_redis
|
- shlink_redis
|
||||||
- shlink_mercure
|
- shlink_mercure
|
||||||
|
- shlink_mercure_proxy
|
||||||
environment:
|
environment:
|
||||||
LC_ALL: C
|
LC_ALL: C
|
||||||
|
|
||||||
|
@ -105,6 +107,17 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "6380:6379"
|
- "6380:6379"
|
||||||
|
|
||||||
|
shlink_mercure_proxy:
|
||||||
|
container_name: shlink_mercure_proxy
|
||||||
|
image: nginx:1.17.10-alpine
|
||||||
|
ports:
|
||||||
|
- "8001:80"
|
||||||
|
volumes:
|
||||||
|
- ./:/home/shlink/www
|
||||||
|
- ./data/infra/mercure_proxy_vhost.conf:/etc/nginx/conf.d/default.conf
|
||||||
|
links:
|
||||||
|
- shlink_mercure
|
||||||
|
|
||||||
shlink_mercure:
|
shlink_mercure:
|
||||||
container_name: shlink_mercure
|
container_name: shlink_mercure
|
||||||
image: dunglas/mercure:v0.8
|
image: dunglas/mercure:v0.8
|
||||||
|
@ -113,3 +126,4 @@ services:
|
||||||
environment:
|
environment:
|
||||||
CORS_ALLOWED_ORIGINS: "*"
|
CORS_ALLOWED_ORIGINS: "*"
|
||||||
JWT_KEY: "mercure_jwt_key"
|
JWT_KEY: "mercure_jwt_key"
|
||||||
|
USE_FORWARDED_HEADERS: "1"
|
||||||
|
|
Loading…
Add table
Reference in a new issue