Adding proxy for orthanc

This commit is contained in:
biharck 2019-04-24 15:14:26 -03:00
parent 06e754834f
commit 79b974179e
3 changed files with 80 additions and 1 deletions

3
.gitignore vendored
View File

@ -19,4 +19,5 @@ package-lock.json
yarn-error.log
.DS_Store
example/deps/
example/deps/
sampledata/

View 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

View 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;
}
}
}