Adding proxy for orthanc
This commit is contained in:
parent
06e754834f
commit
79b974179e
3
.gitignore
vendored
3
.gitignore
vendored
@ -19,4 +19,5 @@ package-lock.json
|
||||
yarn-error.log
|
||||
.DS_Store
|
||||
|
||||
example/deps/
|
||||
example/deps/
|
||||
sampledata/
|
||||
32
docker/docker-compose-orthanc.yml
Normal file
32
docker/docker-compose-orthanc.yml
Normal file
@ -0,0 +1,32 @@
|
||||
version: '3.5'
|
||||
|
||||
services:
|
||||
|
||||
orthanc:
|
||||
container_name: orthanc
|
||||
image: jodogne/orthanc-plugins
|
||||
volumes:
|
||||
- ../sampledata:/sampledata
|
||||
ports:
|
||||
- "4242:4242"
|
||||
- "8042:8042"
|
||||
restart: always
|
||||
viewer:
|
||||
container_name: ohif-viewer
|
||||
build:
|
||||
context: ../
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- '80:80'
|
||||
depends_on:
|
||||
- orthanc
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
restart: always
|
||||
proxy:
|
||||
image: nginx
|
||||
restart: always
|
||||
ports:
|
||||
- 8899:80
|
||||
volumes:
|
||||
- ./nginx-proxy/conf/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
46
docker/nginx-proxy/conf/nginx.conf
Normal file
46
docker/nginx-proxy/conf/nginx.conf
Normal file
@ -0,0 +1,46 @@
|
||||
events {
|
||||
worker_connections 4096; ## Default: 1024
|
||||
}
|
||||
|
||||
http {
|
||||
server {
|
||||
listen 80 default_server;
|
||||
server_name localhost;
|
||||
|
||||
#
|
||||
# Wide-open CORS config for nginx
|
||||
#
|
||||
location / {
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
#
|
||||
# Custom headers and headers various browsers *should* be OK with but aren't
|
||||
#
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||
#
|
||||
# Tell client that this pre-flight info is valid for 20 days
|
||||
#
|
||||
add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
if ($request_method = 'POST') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
|
||||
}
|
||||
if ($request_method = 'GET') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
|
||||
}
|
||||
|
||||
proxy_pass http://orthanc:8442;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user