0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 00:10:11 -05:00
penpot/docker/gitpod/files/nginx.conf
madmath03 43e75401d7 🎉 Fully automate dev setup with Gitpod.
This commit implements a fully-automated development setup using Gitpod.io, an
online IDE for GitLab, GitHub, and Bitbucket that enables Dev-Environments-As-Code.
This makes it easy for anyone to get a ready-to-code workspace for any branch,
issue or pull request almost instantly with a single click.

🐳 Gitpod docker image with Clojure

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐳 Fix path to GitPod docker image

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐳 Use sudo for setup

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐳 More sudo commands

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐳 Remove penpot user in gitpod

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐳 Brew install redis

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Init DB and penpot user

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐳 Switch user for installs

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Improve startup and DB init

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Configure gitpod tasks

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Configure gitpod ports

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Setup for mailhog

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐛 Use perms to install mailhog

🐛 Install mailhog before workspace creation

Signed-off-by: mathieu.brunot <mathieu.brunot@monogramm.io>

🔧 Manage signed commits

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Configure tasks to wait on ports

🔧 Improve Gitpod config

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

⬆️ Upgrade deps in gitpod

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🎨 Use absolute path for cd

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Add nginx conf

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Fix nginx config for gitpod

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Ensure nginx listens all incoming

🎨 Change layers order

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🎨 Change layers order

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🔧 Set Nginx logs permissions

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>

🐛 Use sudo to create nginx logs

Signed-off-by: madmath03 <mb.mathieu.brunot@gmail.com>
2021-03-31 14:36:46 +02:00

136 lines
3.7 KiB
Nginx Configuration File

# This Nginx config file is optional.
# If you don't have this file, the Nginx config from the workspace-full docker image will be taken.
worker_processes auto;
pid /var/run/nginx/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
env GITPOD_REPO_ROOT;
events {
worker_connections 768;
# multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 3;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css text/javascript application/javascript application/json application/transit+json;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# include /etc/nginx/sites-enabled/*;
server {
set_by_lua $gitpod_repo_root 'return os.getenv("GITPOD_REPO_ROOT")';
listen 0.0.0.0:3449 default_server;
server_name _;
client_max_body_size 5M;
charset utf-8;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
resolver 8.8.8.8;
etag off;
root $gitpod_repo_root/frontend/resources/public;
location @handle_redirect {
set $redirect_uri "$upstream_http_location";
set $redirect_host "$upstream_http_x_host";
set $redirect_cache_control "$upstream_http_cache_control";
proxy_buffering off;
proxy_set_header Host "$redirect_host";
proxy_hide_header etag;
proxy_hide_header x-amz-id-2;
proxy_hide_header x-amz-request-id;
proxy_hide_header x-amz-meta-server-side-encryption;
proxy_hide_header x-amz-server-side-encryption;
proxy_pass $redirect_uri;
add_header x-internal-redirect "$redirect_uri";
add_header x-cache-control "$redirect_cache_control";
add_header cache-control "$redirect_cache_control";
}
location /assets {
proxy_pass http://127.0.0.1:6060/assets;
recursive_error_pages on;
proxy_intercept_errors on;
error_page 301 302 307 = @handle_redirect;
}
location /internal/assets {
internal;
alias $gitpod_repo_root/backend/resources/public/assets;
add_header x-internal-redirect "$upstream_http_x_accel_redirect";
}
location /api {
proxy_pass http://127.0.0.1:6060/api;
}
location /webhooks {
proxy_pass http://127.0.0.1:6060/webhooks;
}
location /dbg {
proxy_pass http://127.0.0.1:6060/dbg;
}
location /export {
proxy_pass http://127.0.0.1:6061;
}
location /playground {
alias $gitpod_repo_root/experiments/;
add_header Cache-Control "no-cache, max-age=0";
autoindex on;
}
location /ws/notifications {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_pass http://127.0.0.1:6060/ws/notifications;
}
location / {
add_header Cache-Control "no-cache, max-age=0";
}
}
}