Skip to content

Commit

Permalink
Update dev3 configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Sep 28, 2022
1 parent fa6bd4e commit a8cd4c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions files/emr-3-dev/docker-compose.yml
Expand Up @@ -10,7 +10,7 @@ services:
ports:
- "8090:80"
healthcheck:
test: exit 0
test: exit 0
volumes:
- "./proxy.conf:/etc/nginx/nginx.conf"

Expand All @@ -22,7 +22,7 @@ services:
API_URL: /openmrs
SPA_CONFIG_URLS:
healthcheck:
test: ["CMD", "curl", "-fsSL", "http://localhost/ui/index.html"]
test: ["CMD", "curl", "-f", "http://localhost/"]
timeout: 5s

# OpenMRS:
Expand All @@ -39,7 +39,7 @@ services:
OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs}
OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-Admin123}
healthcheck:
test: ["CMD", "curl", "-fsSL", "http://localhost:8080/openmrs"]
test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
timeout: 5s
volumes:
- openmrs-data:/openmrs/data
Expand Down
20 changes: 16 additions & 4 deletions files/emr-3-dev/proxy.conf
Expand Up @@ -25,7 +25,7 @@ http {
default "false";
"https://formbuilder.o3.openmrs.org" "true";
}

map $request_uri $csp_header {
default "default-src 'self' 'unsafe-inline'; base-uri 'self'; font-src 'self'; img-src 'self' data:; frame-ancestors 'self';";
"~^/openmrs/(?:admin|dictionary|module|patientDashboard.form)/" "default-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; base-uri 'self'; font-src 'self'; frame-ancestors 'self';";
Expand All @@ -39,6 +39,10 @@ http {
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy $csp_header;

proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cookie_flags JSESSIONID secure samesite=strict;
proxy_http_version 1.1;

Expand Down Expand Up @@ -71,8 +75,16 @@ http {
application/xhtml+xml
application/xml;

location /openmrs/spa {
# all redirects are relative to the gateway
absolute_redirect off;

location = /openmrs/spa {
return 301 /openmrs/spa/;
}

location /openmrs/spa/ {
proxy_pass http://frontend/;
proxy_redirect http://$host/ /openmrs/spa/;
}

location /openmrs {
Expand Down Expand Up @@ -109,7 +121,7 @@ http {
}

location = / {
return 301 /openmrs/spa;
return 301 /openmrs/spa/;
}
}
}
}

0 comments on commit a8cd4c1

Please sign in to comment.