-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathnginx_example.conf
87 lines (71 loc) · 3.07 KB
/
nginx_example.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
events {
worker_connections 1024;
}
http {
client_max_body_size 7M; # increase maximum body size from default 1M to match https://github.com/qiita-spots/qiita/blob/ac62aba5333f537c32e213855edc39c273aa9871/qiita_pet/static/vendor/js/resumable-uploader.js#L51 (which is 3M). Note that resumable-uploader.js's last chunk can be max. twice as large as chunk size, see: https://github.com/23/resumable.js/issues/51
# ports to redirect for mainqiita
upstream mainqiita {
server localhost:21174;
server localhost:21175;
server localhost:21176;
server localhost:21177;
}
# define variables for the actions that shall be taken for websocket handshake
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# listening to 8080 and redirecting to https
server {
listen 8080;
server_name localhost;
return 301 https://$server_name$request_uri;
}
server {
listen 8383 ssl;
server_name _;
merge_slashes off;
ssl_certificate /home/runner/work/qiita/qiita/qiita_core/support_files/ci_server.crt;
ssl_certificate_key /home/runner/work/qiita/qiita/qiita_core/support_files/ci_server.key;
ssl_session_timeout 5m;
# no catche
expires off;
port_in_redirect off;
# download configuration, based on:
# https://groups.google.com/forum/#!topic/python-tornado/sgadmx8Hd_s
# protected location for working diretory
location /protected-working_dir/ {
internal;
# CHANGE ME: This should match the WORKING_DIR in your qiita
# config. E.g.,
alias /Users/username/qiita/qiita_db/support_files/test_data/working_dir/;
}
# protected location
location /protected/ {
internal;
# CHANGE ME: This should match the BASE_DATA_DIR in your qiita
# config. E.g.,
alias /Users/username/qiita/qiita_db/support_files/test_data/;
}
# enables communiction through websockets.
# Currently, only endpoints /consumer/, /analysis/selected/socket/, and /study/list/socket/ use websockets
location ~ ^/(consumer|analysis/selected/socket|study/list/socket)/ {
proxy_pass $scheme://mainqiita;
proxy_set_header Host $http_host;
proxy_redirect http:// https://;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-Host $http_host;
}
location / {
proxy_pass $scheme://mainqiita;
proxy_redirect off;
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 Accept-Encoding identity;
}
}
}