docklet/conf/nginx_docklet.conf

49 lines
1.7 KiB
Plaintext
Raw Normal View History

2017-04-24 23:31:17 +08:00
server
{
listen %NGINX_PORT;
#ssl on;
#ssl_certificate /etc/nginx/ssl/1604242_iwork.pku.edu.cn.pem;
#ssl_certificate_key /etc/nginx/ssl/1604242_iwork.pku.edu.cn.key;
2017-04-24 23:31:17 +08:00
server_name nginx_docklet.conf;
charset UTF-8;
add_header X-Frame-Options SAMEORIGIN;
merge_slashes off;
rewrite (.*)//+(.*) $1/$2 permanent;
2017-04-24 23:31:17 +08:00
index index.html index.htm;
client_max_body_size 20m;
if ($request_method !~* GET|POST){
return 403;
}
2017-04-24 23:31:17 +08:00
location ~ ^/NginxStatus/ {
stub_status on;
access_log off;
}
location ~ ^/(\d+\.\d+\.\d+\.\d+)/ {
2017-05-16 16:59:48 +08:00
proxy_pass http://$1:%PROXY_PORT;
proxy_set_header Host $host;
2017-04-24 23:31:17 +08:00
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
location / {
client_max_body_size 20m;
2017-04-24 23:31:17 +08:00
client_body_buffer_size 256k;
proxy_connect_timeout 300;
proxy_send_timeout 300;
proxy_read_timeout 300;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
proxy_max_temp_file_size 128m;
proxy_ignore_client_abort on;
proxy_pass http://%MASTER_IP:%WEB_PORT;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}