-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.ebola2018.conf
88 lines (74 loc) · 2.93 KB
/
nginx.ebola2018.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Main server configuration. See below for redirects.
server {
listen _PORT_ ssl;
server_name localhost ebola2018.dide.ic.ac.uk;
ssl_certificate /etc/ebola2018/proxy/certificate.pem;
ssl_certificate_key /etc/ebola2018/proxy/ssl_key.pem;
root /usr/share/nginx/html;
auth_basic "Restricted access";
auth_basic_user_file /etc/ebola2018/proxy/htpasswd;
# Serve up a static page for confirming the server is running
location / {
# try_files /index.html =404;
expires -1;
add_header Cache-Control "public";
}
# Resources for static page
# location /resources/ {
# }
# Pass through to different containers based on url prefix.
# location /api/ {
# proxy_pass http://api:8080/;
# proxy_redirect default;
# # proxy_buffering is off, otherwise nginx downloads
# # the full request before passing it on: This is bad for large files.
# proxy_buffering off;
# proxy_request_buffering off;
# proxy_send_timeout 200s;
# proxy_read_timeout 200s;
# }
location /reports/api/ {
proxy_pass http://reporting_api:8081/;
proxy_redirect default;
# proxy_buffering is off, otherwise nginx downloads
# the full request before passing it on: This is bad for large files.
proxy_buffering off;
}
# location /admin/ {
# proxy_pass http://admin/;
# }
# location /contribution/ {
# proxy_pass http://contrib/;
# }
# location /reports/ {
# proxy_pass http://report/;
# }
# https://support.rstudio.com/hc/en-us/articles/213733868-Running-Shiny-Server-with-a-Proxy
# location /shiny/ {
# rewrite ^/shiny/(.*)$ /$1 break;
# proxy_pass http://shiny_proxy;
# proxy_redirect http://shiny_proxy/ $scheme://$host/shiny/;
# proxy_http_version 1.1;
# # Here we set the Upgrade and Connection headers to allow a protocol switch from HTTP/1.1 to Websocket
# # We have to set these explicitly because they are 'hop-by-hop' headers which are not passed
# # from client to proxied server
# # See nginx.conf for the setup of $http_upgrade and $http_connection
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $connection_upgrade;
# proxy_read_timeout 20d;
# proxy_buffering off;
# # These headers are required because we are proxying https to http
# # Shiny can only run over http
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# }
}
# Redirect all http requests to the SSL endpoint and the correct domain name
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://_HOST_$request_uri;
}