Skip to content

Instantly share code, notes, and snippets.

@budarin
Last active Jan 10, 2021
Embed
What would you like to do?
worker_processes 1;
events {
worker_connections 2048;
}
http {
charset utf-8;
include config/system/mime_types.conf;
default_type text/html;
access_log /dev/stdout;
error_log /dev/stderr;
resolver 127.0.0.11 ipv6=off valid=5s;
resolver_timeout 1s;
brotli on;
brotli_static on;
brotli_comp_level 3;
brotli_types application/json text/plain text/xml;
brotli_min_length 1024;
gzip on;
gzip_static on;
gzip_comp_level 6;
gzip_vary on;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_min_length 1024;
proxy_buffers 8 64k;
proxy_connect_timeout 15s;
proxy_read_timeout 15s;
proxy_send_timeout 15s;
server {
listen 80 default_server;
server_name localhost;
location /health-check {
default_type text/html;
return 200 'Ok';
}
include config/locations/static_dev.conf;
set $local 'host.docker.internal';
location ~ ^/api/(.*)$ {
proxy_pass http://$local:5005/$1;
proxy_set_header qqq $1;
proxy_pass_header Server;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_headers "Cache-Control" "Expires" "Vary" "Set-Cookie" "X-Accel-Expires";
}
location / {
proxy_pass http://$local:3000;
proxy_pass_header Server;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_ignore_headers "Cache-Control" "Expires" "Vary" "Set-Cookie" "X-Accel-Expires";
}
}
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webp|webm|htc)$ {
# expires -1;
include config/disable/access_logs.conf;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
add_header Cache-Control "public";
root /var/www/assets/;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment