UNPKG

4.63 kBPlain TextView Raw
1##
2# You should look at the following URL's in order to grasp a solid understanding
3# of Nginx configuration files in order to fully unleash the power of Nginx.
4# http://wiki.nginx.org/Pitfalls
5# http://wiki.nginx.org/QuickStart
6# http://wiki.nginx.org/Configuration
7#
8# Generally, you will want to move this file somewhere, and start with a clean
9# file but keep this around for reference. Or just disable in sites-enabled.
10#
11# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
12##
13
14# Default server configuration
15#
16server {
17 listen 80 default_server;
18 listen [::]:80 default_server;
19
20 #proxy_connect_timeout 100s;
21 #proxy_send_timeout 100s;
22 #proxy_read_timeout 100s;
23 #send_timeout 100s;
24
25 # SSL configuration
26 #
27 # listen 443 ssl default_server;
28 # listen [::]:443 ssl default_server;
29 #
30 # Note: You should disable gzip for SSL traffic.
31 # See: https://bugs.debian.org/773332
32 #
33 # Read up on ssl_ciphers to ensure a secure configuration.
34 # See: https://bugs.debian.org/765782
35 #
36 # Self signed certs generated by the ssl-cert package
37 # Don't use them in a production server!
38 #
39 # include snippets/snakeoil.conf;
40
41 # root /var/www;
42
43 index index.html index.htm index.nginx-debian.html;
44
45 server_name _;
46
47 # Serve up static content directly via nginx
48
49 # Note: /var/www is a symlink to ~/qewd/www
50
51 location / {
52 root /var/www;
53 try_files $uri $uri/ @qewd;
54
55 expires max;
56 access_log off;
57 }
58
59 # Proxy all non-static content via QEWD
60
61 location @qewd {
62
63 proxy_pass http://localhost:3000;
64 proxy_http_version 1.1;
65 proxy_set_header Upgrade $http_upgrade;
66 proxy_set_header Connection 'upgrade';
67 proxy_set_header Host $host;
68 proxy_cache_bypass $http_upgrade;
69 }
70
71
72 # /instances fetches images from Dicom server at demo.rippleosi.org
73
74 location /instances/ {
75 proxy_pass http://46.101.59.223:8042;
76 proxy_set_header HOST $host;
77 proxy_set_header X-Real-IP $remote_addr;
78 # rewrite /orthanc(.*) $1 break;
79 add_header 'Access-Control-Allow-Credentials' 'true';
80 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
81 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
82 add_header 'Access-Control-Allow-Origin' '*';
83 }
84
85 # /api-docs points to Swagger
86 location /api-docs {
87 proxy_pass http://localhost:3001/api-docs;
88 }
89
90}
91
92server {
93
94 # SSL configuration
95 #
96 listen 443 ssl default_server;
97 listen [::]:443 ssl default_server;
98
99 ssl_certificate /var/ssl/ssl.crt;
100 ssl_certificate_key /var/ssl/ssl.key;
101
102 #
103 # Note: You should disable gzip for SSL traffic.
104 # See: https://bugs.debian.org/773332
105 #
106 # Read up on ssl_ciphers to ensure a secure configuration.
107 # See: https://bugs.debian.org/765782
108 #
109 # Self signed certs generated by the ssl-cert package
110 # Don't use them in a production server!
111 #
112 # include snippets/snakeoil.conf;
113
114 # root /var/www;
115
116 index index.html index.htm index.nginx-debian.html;
117
118 server_name _;
119
120 # Serve up static content directly via nginx
121
122 # Note: /var/www is a symlink to ~/qewd/www
123
124 location / {
125 root /var/www;
126 try_files $uri $uri/ @qewd;
127
128 expires max;
129 access_log off;
130 }
131
132 # Proxy all non-static content via QEWD
133
134 location @qewd {
135 proxy_pass https://localhost:8081;
136 proxy_http_version 1.1;
137 proxy_set_header Upgrade $http_upgrade;
138 proxy_set_header Connection 'upgrade';
139 proxy_set_header Host $host;
140 proxy_cache_bypass $http_upgrade;
141 }
142
143
144 # /instances fetches images from Dicom server at demo.rippleosi.org
145
146 location /instances/ {
147 proxy_pass http://46.101.59.223:8042;
148 proxy_set_header HOST $host;
149 proxy_set_header X-Real-IP $remote_addr;
150 # rewrite /orthanc(.*) $1 break;
151 add_header 'Access-Control-Allow-Credentials' 'true';
152 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
153 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
154 add_header 'Access-Control-Allow-Origin' '*';
155 }
156
157 # /api-docs points to Swagger
158 location /api-docs {
159 proxy_pass https://localhost:8081/api-docs;
160 }
161
162}
163
164