Mercurial > hg > orthanc-book
annotate Sphinx/source/faq/nginx.rst @ 278:9bf644571511
fix doc wrt recycling order
author | amazy |
---|---|
date | Mon, 09 Sep 2019 12:34:27 +0200 |
parents | 857f4870fd7f |
children | 95edfd8ab641 |
rev | line source |
---|---|
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/ { | |
261
857f4870fd7f
nginx: localhost to 127.0.0.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
14 proxy_pass http://127.0.0.1:8042; |
0 | 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/ { | |
261
857f4870fd7f
nginx: localhost to 127.0.0.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
114
diff
changeset
|
45 proxy_pass http://127.0.0.1:8042; |
0 | 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 |