## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # http://wiki.nginx.org/Pitfalls # http://wiki.nginx.org/QuickStart # http://wiki.nginx.org/Configuration # # Generally, you will want to move this file somewhere, and start with a clean # file but keep this around for reference. Or just disable in sites-enabled. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; #proxy_connect_timeout 100s; #proxy_send_timeout 100s; #proxy_read_timeout 100s; #send_timeout 100s; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; # root /var/www; index index.html index.htm index.nginx-debian.html; server_name _; # Serve up static content directly via nginx # Note: /var/www is a symlink to ~/qewd/www location / { root /var/www; try_files $uri $uri/ @qewd; expires max; access_log off; } # Proxy all non-static content via QEWD location @qewd { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } # /instances fetches images from Dicom server at demo.rippleosi.org location /instances/ { proxy_pass http://46.101.59.223: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' '*'; } # /api-docs points to Swagger location /api-docs { proxy_pass http://localhost:3001/api-docs; } } server { # SSL configuration # listen 443 ssl default_server; listen [::]:443 ssl default_server; ssl_certificate /var/ssl/ssl.crt; ssl_certificate_key /var/ssl/ssl.key; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; # root /var/www; index index.html index.htm index.nginx-debian.html; server_name _; # Serve up static content directly via nginx # Note: /var/www is a symlink to ~/qewd/www location / { root /var/www; try_files $uri $uri/ @qewd; expires max; access_log off; } # Proxy all non-static content via QEWD location @qewd { proxy_pass https://localhost:8081; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } # /instances fetches images from Dicom server at demo.rippleosi.org location /instances/ { proxy_pass http://46.101.59.223: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' '*'; } # /api-docs points to Swagger location /api-docs { proxy_pass https://localhost:8081/api-docs; } }