## Description Added Appsmith Initializing and Starting pages to inform the users that Appsmith is starting up and they will need to wait for a few minutes before their Appsmith deployment is up and running, instead of displaying the 503 error like it earlier. ## Type of change - New feature (non-breaking change which adds functionality) # Media Initialization page  Starting page  [Demo Video](https://drive.google.com/file/d/1sjvfbtbWHRqVfg0Vvf2JM6W3y61-KrWm/view?usp=share_link) ## How Has This Been Tested? - Manual --------- Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com> Co-authored-by: Arpit Mohan <mohanarpit@users.noreply.github.com>
107 lines
2.4 KiB
Bash
107 lines
2.4 KiB
Bash
#!/bin/bash
|
|
|
|
set -o nounset
|
|
|
|
CUSTOM_DOMAIN="$1"
|
|
|
|
if [[ -z $CUSTOM_DOMAIN ]]; then
|
|
CUSTOM_DOMAIN=_
|
|
fi
|
|
|
|
cat <<EOF
|
|
map \$http_x_forwarded_proto \$origin_scheme {
|
|
default \$http_x_forwarded_proto;
|
|
'' \$scheme;
|
|
}
|
|
|
|
map \$http_x_forwarded_host \$origin_host {
|
|
default \$http_x_forwarded_host;
|
|
'' \$host;
|
|
}
|
|
|
|
# redirect log to stdout for supervisor to capture
|
|
access_log /dev/stdout;
|
|
|
|
server {
|
|
listen ${PORT:-80} default_server;
|
|
server_name $CUSTOM_DOMAIN;
|
|
|
|
client_max_body_size 150m;
|
|
|
|
gzip on;
|
|
gzip_types *;
|
|
|
|
server_tokens off;
|
|
|
|
root /opt/appsmith/editor;
|
|
index index.html;
|
|
error_page 404 /;
|
|
|
|
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors
|
|
add_header Content-Security-Policy "frame-ancestors ${APPSMITH_ALLOWED_FRAME_ANCESTORS-'self' *}";
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /appsmith-stacks/data/certificate/certbot;
|
|
}
|
|
|
|
location = /supervisor {
|
|
return 301 /supervisor/;
|
|
}
|
|
|
|
location /supervisor/ {
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
proxy_max_temp_file_size 0;
|
|
proxy_redirect off;
|
|
|
|
proxy_set_header Host \$http_host/supervisor/;
|
|
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto \$origin_scheme;
|
|
proxy_set_header X-Forwarded-Host \$origin_host;
|
|
proxy_set_header Connection "";
|
|
|
|
proxy_pass http://localhost:9001/;
|
|
|
|
auth_basic "Protected";
|
|
auth_basic_user_file /etc/nginx/passwords;
|
|
}
|
|
|
|
proxy_set_header X-Forwarded-Proto \$origin_scheme;
|
|
proxy_set_header X-Forwarded-Host \$origin_host;
|
|
|
|
location / {
|
|
try_files /loading.html \$uri /index.html =404;
|
|
}
|
|
|
|
location ~ ^/static/(js|css|media)\b {
|
|
# Files in these folders are hashed, so we can set a long cache time.
|
|
add_header Cache-Control "max-age=31104000, immutable"; # 360 days
|
|
}
|
|
|
|
# If the path has an extension at the end, then respond with 404 status if the file not found.
|
|
location ~ ^/(?!supervisor/).*\.[a-z]+$ {
|
|
try_files \$uri =404;
|
|
}
|
|
|
|
location /api {
|
|
proxy_pass http://localhost:8080;
|
|
}
|
|
|
|
location /oauth2 {
|
|
proxy_pass http://localhost:8080;
|
|
}
|
|
|
|
location /login {
|
|
proxy_pass http://localhost:8080;
|
|
}
|
|
|
|
location /rts {
|
|
proxy_pass http://localhost:${APPSMITH_RTS_PORT:-8091};
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host \$host;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Upgrade \$http_upgrade;
|
|
}
|
|
}
|
|
EOF
|