|
# |
|
# nginx configuration to expose st2 webui, redirect HTTP->HTTPS, |
|
# provide SSL termination, and reverse-proxy st2api and st2auth API endpoint. |
|
# To enable: |
|
# cp ${LOCATION}/st2.conf /etc/nginx/sites-available |
|
# ln -l /etc/nginx/sites-available/st2.conf /etc/nginx/sites-enabled/st2.conf |
|
# see https://docs.stackstorm.com/install.html for details |
|
|
|
server { |
|
listen *:80 default_server; |
|
|
|
add_header Front-End-Https on; |
|
add_header X-Content-Type-Options nosniff; |
|
|
|
if ($ssl_protocol = "") { |
|
return 301 https://$host$request_uri; |
|
} |
|
|
|
index index.html index.htm index.php; |
|
|
|
access_log /var/log/nginx/st2webui.access.log combined; |
|
error_log /var/log/nginx/st2webui.error.log; |
|
} |
|
|
|
server { |
|
listen *:443 ssl; |
|
|
|
ssl on; |
|
|
|
ssl_certificate /etc/ssl/st2/st2.crt; |
|
ssl_certificate_key /etc/ssl/st2/st2.key; |
|
ssl_session_cache shared:SSL:10m; |
|
ssl_session_timeout 5m; |
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
|
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-RSA-AES128-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA128:DHE-RSA-AES128-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA128:ECDHE-RSA-AES128-SHA384:ECDHE-RSA-AES128-SHA128:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA128:DHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA384:AES128-GCM-SHA128:AES128-SHA128:AES128-SHA128:AES128-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4; |
|
ssl_prefer_server_ciphers on; |
|
|
|
index index.html index.htm index.php; |
|
|
|
access_log /var/log/nginx/ssl-st2webui.access.log combined; |
|
error_log /var/log/nginx/ssl-st2webui.error.log; |
|
|
|
add_header Front-End-Https on; |
|
add_header X-Content-Type-Options nosniff; |
|
|
|
location /api/ { |
|
rewrite ^/api/(.*) /$1 break; |
|
|
|
proxy_pass http://127.0.0.1:9101/; |
|
proxy_read_timeout 90; |
|
proxy_connect_timeout 90; |
|
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 Connection ''; |
|
chunked_transfer_encoding off; |
|
proxy_buffering off; |
|
proxy_cache off; |
|
proxy_set_header Host $host; |
|
} |
|
|
|
location /stream/ { |
|
rewrite ^/stream/(.*) /$1 break; |
|
|
|
proxy_pass http://127.0.0.1:9102/; |
|
proxy_read_timeout 90; |
|
proxy_connect_timeout 90; |
|
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_pass_header Authorization; |
|
|
|
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. |
|
proxy_set_header Connection ''; |
|
chunked_transfer_encoding off; |
|
proxy_buffering off; |
|
proxy_cache off; |
|
proxy_set_header Host $host; |
|
} |
|
|
|
# For backward compatibility reasons, rewrite requests from "/api/stream" |
|
# to "/stream/v1/stream" and "/api/v1/stream" to "/stream/v1/stream" |
|
location /api/stream/ { |
|
rewrite ^/api/stream/?(.*)$ /v1/stream/$1 break; |
|
proxy_pass http://127.0.0.1:9102; |
|
proxy_set_header Host $host; |
|
proxy_set_header X-Real-IP $remote_addr; |
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
|
|
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. |
|
proxy_set_header Connection ''; |
|
chunked_transfer_encoding off; |
|
proxy_buffering off; |
|
proxy_cache off; |
|
} |
|
|
|
location /api/v1/stream/ { |
|
rewrite ^/api/v1/stream/?(.*)$ /v1/stream/$1 break; |
|
proxy_pass http://127.0.0.1:9102; |
|
proxy_set_header Host $host; |
|
proxy_set_header X-Real-IP $remote_addr; |
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|
|
|
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. |
|
proxy_set_header Connection ''; |
|
chunked_transfer_encoding off; |
|
proxy_buffering off; |
|
proxy_cache off; |
|
} |
|
|
|
location /auth/ { |
|
rewrite ^/auth/(.*) /$1 break; |
|
|
|
proxy_pass http://127.0.0.1:9100/; |
|
proxy_read_timeout 90; |
|
proxy_connect_timeout 90; |
|
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_pass_header Authorization; |
|
|
|
proxy_set_header Connection ''; |
|
chunked_transfer_encoding off; |
|
proxy_buffering off; |
|
proxy_cache off; |
|
proxy_set_header Host $host; |
|
} |
|
|
|
location /mistral/ { |
|
rewrite ^/mistral/(.*) /$1 break; |
|
|
|
proxy_pass http://127.0.0.1:8989/; |
|
proxy_read_timeout 90; |
|
proxy_connect_timeout 90; |
|
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_pass_header Authorization; |
|
|
|
proxy_set_header Connection ''; |
|
chunked_transfer_encoding off; |
|
proxy_buffering off; |
|
proxy_cache off; |
|
proxy_set_header Host $host; |
|
} |
|
|
|
} |