Skip to content

Instantly share code, notes, and snippets.

@jmhmd
Last active March 12, 2024 16:26
Show Gist options
  • Save jmhmd/43fe6d941a48d0c3ac441bc263c66190 to your computer and use it in GitHub Desktop.
Save jmhmd/43fe6d941a48d0c3ac441bc263c66190 to your computer and use it in GitHub Desktop.
Example pacsbin CORS nginx config
server {
listen 80;
server_name dicomwebproxy.hospital.org; # set to desired address of proxy server
add_header 'Access-Control-Allow-Origin' 'pacsbin.com'; # Can set to '*' instead of 'pacsbin.com' to accept any domain
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Headers' '*';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS';
location / {
if ($request_method = 'OPTIONS') {
add_header 'Content-Length' 0;
return 204;
}
proxy_redirect off;
proxy_set_header host $host;
proxy_pass http://dhha-dicomweb-server-url.hospital.org; # address of dicomweb server base url
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment