split nginx into different configs
This commit is contained in:
parent
4320acfc12
commit
b5edddb606
3
.env
3
.env
@ -1,7 +1,8 @@
|
|||||||
#
|
#
|
||||||
# Nginx configuration
|
# Nginx configuration
|
||||||
#
|
#
|
||||||
NGINX_DEFAULT_CONF=./config/ohif/nginx.conf
|
NGINX_DEFAULT_CONF=./config/ohif/nginx/default.conf
|
||||||
|
NGINX_OHIF_CONF=./config/ohif/nginx/ohif.conf
|
||||||
|
|
||||||
#
|
#
|
||||||
# OHIF Viewer
|
# OHIF Viewer
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
# set client body size to 500M, this is to allow uploading of DICOMs, throws '413 request entity too large nginx' error otherwise #
|
|
||||||
client_max_body_size 500M;
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
|
|
||||||
location = /50x.html {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
}
|
|
||||||
|
|
||||||
# https://book.orthanc-server.com/faq/nginx.html#nginx
|
|
||||||
location /orthanc/ {
|
|
||||||
proxy_pass http://orthanc:8042;
|
|
||||||
proxy_set_header HOST $host;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
rewrite /orthanc(.*) $1 break;
|
|
||||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
|
||||||
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
|
||||||
}
|
|
||||||
}
|
|
5
config/ohif/nginx/default.conf
Normal file
5
config/ohif/nginx/default.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
include /etc/nginx/enabled-sites/*.conf;
|
||||||
|
client_max_body_size 250M;
|
||||||
|
}
|
32
config/ohif/nginx/ohif.conf
Normal file
32
config/ohif/nginx/ohif.conf
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
|
||||||
|
add_header Cross-Origin-Opener-Policy same-origin;
|
||||||
|
add_header Cross-Origin-Embedder-Policy require-corp;
|
||||||
|
add_header Cross-Origin-Resource-Policy same-origin;
|
||||||
|
proxy_set_header Host $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 $http_x_forwarded_proto;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://book.orthanc-server.com/faq/nginx.html#nginx
|
||||||
|
location /orthanc/ {
|
||||||
|
proxy_pass http://orthanc:8042;
|
||||||
|
proxy_set_header HOST $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
rewrite /orthanc(.*) $1 break;
|
||||||
|
|
||||||
|
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||||
|
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
||||||
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
|
}
|
@ -16,7 +16,16 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${POSTGRES_DATA_MNT}:${PGDATA}
|
- ${POSTGRES_DATA_MNT}:${PGDATA}
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}"]
|
test:
|
||||||
|
[
|
||||||
|
"CMD",
|
||||||
|
"pg_isready",
|
||||||
|
"-q",
|
||||||
|
"-d",
|
||||||
|
"${POSTGRES_DB}",
|
||||||
|
"-U",
|
||||||
|
"${POSTGRES_USER}",
|
||||||
|
]
|
||||||
start_period: 20s
|
start_period: 20s
|
||||||
interval: 30s
|
interval: 30s
|
||||||
retries: 5
|
retries: 5
|
||||||
@ -75,6 +84,7 @@ services:
|
|||||||
- APP_CONFIG=/usr/share/nginx/html/app-config.js
|
- APP_CONFIG=/usr/share/nginx/html/app-config.js
|
||||||
volumes:
|
volumes:
|
||||||
- ${NGINX_DEFAULT_CONF}:/etc/nginx/conf.d/default.conf:ro
|
- ${NGINX_DEFAULT_CONF}:/etc/nginx/conf.d/default.conf:ro
|
||||||
|
- ${NGINX_OHIF_CONF}:/etc/nginx/enabled-sites/ohif.conf:ro
|
||||||
- ${OHIF_CONFIG}:/usr/share/nginx/html/app-config.js:ro
|
- ${OHIF_CONFIG}:/usr/share/nginx/html/app-config.js:ro
|
||||||
- ${OHIF_LOGO}:/usr/share/nginx/html/logo.png:ro
|
- ${OHIF_LOGO}:/usr/share/nginx/html/logo.png:ro
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
Loading…
Reference in New Issue
Block a user