|
| 1 | +proxy_busy_buffers_size 512k; |
| 2 | +proxy_buffers 4 512k; |
| 3 | +proxy_buffer_size 256k; |
| 4 | +client_max_body_size 50m; |
| 5 | +# override default location / |
| 6 | +location / { |
| 7 | + add_header X-Served-By $host; |
| 8 | + proxy_set_header Host $host; |
| 9 | + proxy_set_header X-Forwarded-Scheme $scheme; |
| 10 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 11 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 12 | + proxy_set_header X-Real-IP $remote_addr; |
| 13 | + proxy_pass $forward_scheme://$server:$port$request_uri; |
| 14 | + proxy_set_header Upgrade $http_upgrade; |
| 15 | + proxy_set_header Connection upgrade; |
| 16 | + } |
| 17 | + |
| 18 | +location /console { |
| 19 | + proxy_pass http://$server:8080; |
| 20 | + proxy_http_version 1.1; |
| 21 | + proxy_set_header Host $http_host; |
| 22 | + proxy_set_header X-Real-IP $remote_addr; |
| 23 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 24 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 25 | +} |
| 26 | + |
| 27 | +# for echo some useful information |
| 28 | +location / { |
| 29 | + default_type text/plain; |
| 30 | + return 200 'Hello World'; |
| 31 | +} |
| 32 | + |
| 33 | +location /oida/ { |
| 34 | +# this is the address and port of the ORDS installation |
| 35 | +proxy_pass http://127.0.0.1:8080/ords/; |
| 36 | + |
| 37 | +# set Origin to blank to avoid Chrome problems with CORS |
| 38 | +proxy_set_header Origin "" ; |
| 39 | + |
| 40 | +# pass along some header variables with the public host name/port/and so on |
| 41 | +proxy_set_header Host $host; |
| 42 | +proxy_set_header X-Forwarded-Host $host:$server_port; |
| 43 | +proxy_set_header X-Real-IP $remote_addr; |
| 44 | +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 45 | +proxy_set_header X-Forwarded-Proto $scheme; |
| 46 | + |
| 47 | +# this reverse proxies any "location" headers being passed in the response |
| 48 | +proxy_redirect http://$host/ords/ https://$host/oida/; |
| 49 | + |
| 50 | +# also tell cookies their public path |
| 51 | +proxy_cookie_path /ords/ /oida/; |
| 52 | + |
| 53 | +# reverse proxy links included in response (ie from ORDS webservice) |
| 54 | +sub_filter_types application/json ; |
| 55 | +sub_filter http://$host/ords/ https://$host/oida/; |
| 56 | +sub_filter_once off; |
| 57 | +} |
0 commit comments