diff --git a/conf/nginx/st2.conf b/conf/nginx/st2.conf index 96394ccce4..41f8bcf6a3 100644 --- a/conf/nginx/st2.conf +++ b/conf/nginx/st2.conf @@ -60,7 +60,7 @@ server { error_page 502 = @apiError; rewrite ^/api/(.*) /$1 break; - + proxy_pass http://127.0.0.1:9101/; proxy_read_timeout 90; proxy_connect_timeout 90; @@ -76,6 +76,13 @@ server { proxy_cache off; proxy_set_header Host $host; max_ranges 0; + + # In a lot of scenarios, it may be beneficial to enable response compression (especially when + # working with large executions and StackStorm instance is accessed over public internet). + # To enable it, uncomment the lines below and adjust according to your needs. + # gzip on; + # gzip_min_length 1024; + # gzip_types text/plain application/json text/event-stream; } location @streamError { @@ -102,7 +109,7 @@ server { sendfile on; tcp_nopush on; tcp_nodelay on; - + # Disable buffering and chunked encoding. # In the stream case we want to receive the whole payload at once, we don't # want multiple chunks. @@ -111,6 +118,14 @@ server { proxy_buffering off; proxy_cache off; max_ranges 0; + + # In a lot of scenarios, it may be beneficial to enable response compression (especially when + # working with large executions and StackStorm instance is accessed over public internet). + # To enable it, uncomment the lines below and adjust according to your needs. + # gzip on; + # gzip_min_length 1024; + # gzip_types text/plain application/json text/event-stream; + # gzip_proxied no-cache no-store private expired auth; } location @authError { @@ -122,7 +137,7 @@ server { error_page 502 = @authError; rewrite ^/auth/(.*) /$1 break; - + proxy_pass http://127.0.0.1:9100/; proxy_read_timeout 90; proxy_connect_timeout 90;