0
|
1 .. _nginx:
|
|
2
|
|
3 How can I run Orthanc behind nginx?
|
|
4 ===================================
|
|
5
|
|
6 Similarly to :ref:`Apache <apache>`, Orthanc can run behind `nginx
|
|
7 <https://en.wikipedia.org/wiki/Nginx>`__ through reverse
|
|
8 proxying. Here is the configuration snippet for nginx::
|
|
9
|
|
10 server {
|
|
11 listen 80 default_server;
|
|
12 ...
|
|
13 location /orthanc/ {
|
|
14 proxy_pass http://localhost:8042;
|
|
15 proxy_set_header HOST $host;
|
|
16 proxy_set_header X-Real-IP $remote_addr;
|
|
17 rewrite /orthanc(.*) $1 break;
|
|
18 }
|
|
19 ...
|
|
20 }
|
|
21
|
|
22 *Note:* Thanks to Qaler for `submitting this information
|
|
23 <https://groups.google.com/d/msg/orthanc-users/oTMCM6kElfw/uj0r062mptoJ>`__.
|
|
24
|
114
|
25 You might also wish to adapt the ``client_max_body_size``
|
|
26 `configuration option of nginx
|
|
27 <http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size>`__
|
|
28 to allow the uploading of DICOM files larger than the default 1MB if
|
|
29 using the :ref:`REST API <sending-dicom-images>` of Orthanc.
|
|
30
|
0
|
31
|
|
32 .. _nginx-cors:
|
|
33
|
|
34 Enabling CORS
|
|
35 -------------
|
|
36
|
|
37 It is also possible to enable `cross-origin resource sharing (CORS)
|
|
38 <https://en.wikipedia.org/wiki/Cross-origin_resource_sharing>`_ with
|
|
39 nginx::
|
|
40
|
|
41 server {
|
|
42 listen 80 default_server;
|
|
43 ...
|
|
44 location /orthanc/ {
|
|
45 proxy_pass http://localhost:8042;
|
|
46 proxy_set_header HOST $host;
|
|
47 proxy_set_header X-Real-IP $remote_addr;
|
|
48 rewrite /orthanc(.*) $1 break;
|
|
49 add_header 'Access-Control-Allow-Credentials' 'true';
|
|
50 add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
|
|
51 add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
52 add_header 'Access-Control-Allow-Origin' '*';
|
|
53 }
|
|
54 ...
|
|
55 }
|
|
56
|
|
57 *Note:* Thanks to Fernando for `submitting this information
|
|
58 <https://groups.google.com/d/msg/orthanc-users/LH-ej_fB-dw/CmWP4jM3BgAJ>`__.
|
|
59
|