Skip to content

Instantly share code, notes, and snippets.

@alazycoder101
Last active December 25, 2022 11:35
Show Gist options
  • Save alazycoder101/8cf0df0aed5082aa5cb1412853567552 to your computer and use it in GitHub Desktop.
Save alazycoder101/8cf0df0aed5082aa5cb1412853567552 to your computer and use it in GitHub Desktop.
configmap for nginx
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
namespace: re
data:
nginx.conf: |
user nginx;
# should equal to `cat /proc/cpuinfo | grep processor | wc -l`
worker_processes auto;
timer_resolution 10000ms;
thread_pool default threads=32 max_queue=65536;
events {
# should equal to `ulimit -n`
worker_connections 1024;
multi_accept on;
# the effective method, used on Linux 2.6+
use epoll;
}
# worker_rlimit_nofile = worker_connections * worker_processes
worker_rlimit_nofile 4096;
http {
include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_comp_level 3;
gzip_buffers 16 8k;
gzip_proxied any;
gzip_static on;
gzip_types text/css text/javasript text/xml text/plain application/javascript application/x-javascript application/json application/vnd.api+json application/xml application/rss+xml font/truetype font/opentype image/svg+xml;
gzip_vary on;
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://customer.test;
}
location /status {
access_log off;
return 200;
}
location /static/ {
rewrite ^/static/$ /static/index.html$1 last;
proxy_pass http://storage.googleapis.com/static_bucket/static/;
proxy_set_header Host storage.googleapis.com;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment