d753a92a5c
* feat(frontend-2): deploy to docker-compose environment - including DigitalOcean 1-click environments - local docker compose environment deploys an nginx ingress - builds and publishes docker-compose-ingress via CircleCI - sets platform variable for ensuring correct runtime is built - frontend-2 should connect to speckle server directly within the docker compose network --------- Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
138 lines
3.7 KiB
Plaintext
138 lines
3.7 KiB
Plaintext
pcre_jit on;
|
|
error_log stderr info;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
# move default write paths to a custom directory
|
|
# kubernetes can mount this directory and prevent writes to the root directory
|
|
# https://github.com/openresty/docker-openresty/issues/119
|
|
client_body_temp_path /var/nginx/nginx-client-body;
|
|
proxy_temp_path /var/nginx/nginx-proxy;
|
|
fastcgi_temp_path /var/nginx/nginx-fastcgi;
|
|
uwsgi_temp_path /var/nginx/nginx-uwsgi;
|
|
scgi_temp_path /var/nginx/nginx-scgi;
|
|
|
|
log_format json_combined escape=json
|
|
'{'
|
|
'"time_local":"$time_local",'
|
|
'"remote_addr":"$remote_addr",'
|
|
'"remote_user":"$remote_user",'
|
|
'"request":"$request",'
|
|
'"status": "$status",'
|
|
'"body_bytes_sent":"$body_bytes_sent",'
|
|
'"request_time":"$request_time",'
|
|
'"http_referrer":"$http_referer",'
|
|
'"http_user_agent":"$http_user_agent"'
|
|
'}';
|
|
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
access_log /dev/stdout json_combined;
|
|
|
|
# Speckle configuration
|
|
server_tokens off;
|
|
gzip on;
|
|
gzip_disable "msie6";
|
|
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_buffers 16 8k;
|
|
gzip_http_version 1.1;
|
|
gzip_min_length 256;
|
|
gzip_types
|
|
application/atom+xml
|
|
application/geo+json
|
|
application/javascript
|
|
application/x-javascript
|
|
application/json
|
|
application/ld+json
|
|
application/manifest+json
|
|
application/rdf+xml
|
|
application/rss+xml
|
|
application/xhtml+xml
|
|
application/xml
|
|
font/eot
|
|
font/otf
|
|
font/ttf
|
|
image/svg+xml
|
|
text/css
|
|
text/javascript
|
|
text/plain
|
|
text/xml;
|
|
|
|
set_real_ip_from 103.21.244.0/22;
|
|
set_real_ip_from 103.22.200.0/22;
|
|
set_real_ip_from 103.31.4.0/22;
|
|
set_real_ip_from 104.16.0.0/13;
|
|
set_real_ip_from 104.24.0.0/14;
|
|
set_real_ip_from 108.162.192.0/18;
|
|
set_real_ip_from 131.0.72.0/22;
|
|
set_real_ip_from 141.101.64.0/18;
|
|
set_real_ip_from 162.158.0.0/15;
|
|
set_real_ip_from 172.64.0.0/13;
|
|
set_real_ip_from 173.245.48.0/20;
|
|
set_real_ip_from 188.114.96.0/20;
|
|
set_real_ip_from 190.93.240.0/20;
|
|
set_real_ip_from 197.234.240.0/22;
|
|
set_real_ip_from 198.41.128.0/17;
|
|
set_real_ip_from 2400:cb00::/32;
|
|
set_real_ip_from 2606:4700::/32;
|
|
set_real_ip_from 2803:f800::/32;
|
|
set_real_ip_from 2405:b500::/32;
|
|
set_real_ip_from 2405:8100::/32;
|
|
set_real_ip_from 2c0f:f248::/32;
|
|
set_real_ip_from 2a06:98c0::/29;
|
|
|
|
#use any of the following two
|
|
real_ip_header CF-Connecting-IP;
|
|
#real_ip_header X-Forwarded-For;
|
|
|
|
server {
|
|
listen 8080;
|
|
client_max_body_size 100m;
|
|
|
|
location / {
|
|
resolver 127.0.0.11 valid=30s;
|
|
set $upstream_speckle_frontend_2 speckle-frontend-2;
|
|
client_max_body_size ${FILE_SIZE_LIMIT_MB}m;
|
|
proxy_pass http://$upstream_speckle_frontend_2:8080;
|
|
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
location ~* ^/(graphql|explorer|(auth/.*)|(objects/.*)|(preview/.*)|(api/.*)|(static/.*)) {
|
|
resolver 127.0.0.11 valid=30s;
|
|
set $upstream_speckle_server speckle-server;
|
|
client_max_body_size ${FILE_SIZE_LIMIT_MB}m;
|
|
proxy_pass http://$upstream_speckle_server:3000;
|
|
|
|
proxy_buffering off;
|
|
proxy_request_buffering off;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
|
|
location = /50x.html {
|
|
root /app;
|
|
}
|
|
}
|
|
}
|