Skip to content

Instantly share code, notes, and snippets.

@sgoings
Created December 16, 2015 23:37
Show Gist options
  • Save sgoings/4879d6dddaa2ed3f3fad to your computer and use it in GitHub Desktop.
Save sgoings/4879d6dddaa2ed3f3fad to your computer and use it in GitHub Desktop.
kubectl exec --namespace=deis deis-router-jwjj1 cat /opt/nginx/conf/nginx.conf
user nginx;
daemon off;
pid /run/nginx.pid;
worker_processes auto;
events {
worker_connections 768;
# multi_accept on;
}
http {
# basic settings
vhost_traffic_status_zone;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
# The timeout value must be greater than the front facing load balancers timeout value.
# Default is the deis recommended timeout value for ELB - 1200 seconds + 100s extra.
keepalive_timeout 1300s;
types_hash_max_size 2048;
server_names_hash_max_size 512;
server_names_hash_bucket_size 64;
gzip on;
gzip_comp_level 5;
gzip_disable msie6;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types application/atom+xml application/javascript application/json application/rss+xml application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/svg+xml image/x-icon text/css text/plain text/x-component;
gzip_proxied any;
gzip_vary on;
client_max_body_size 1m;
log_format upstreaminfo '[$time_local] - $remote_addr - $remote_user - $status - "$request" - $bytes_sent - "$http_referer" - "$http_user_agent" - "$server_name" - $upstream_addr - $http_host - $upstream_response_time - $request_time';
access_log /opt/nginx/logs/access.log upstreaminfo;
error_log /opt/nginx/logs/error.log error;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Default server handles requests for unmapped hostnames, including healthchecks
server {
listen 80 default_server reuseport;
server_name _;
location ~ ^/healthz/?$ {
access_log off;
default_type 'text/plain';
return 200;
}
location / {
return 404;
}
}
# Healthcheck on 9090 -- never uses proxy_protocol
server {
listen 9090 default_server;
server_name _;
location ~ ^/healthz/?$ {
access_log off;
default_type 'text/plain';
return 200;
}
location / {
return 404;
}
}
server {
listen 80;
server_name deis.104.197.67.227.xip.io;
server_name_in_redirect off;
port_in_redirect off;
location / {
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_connect_timeout 10s;
proxy_send_timeout 1200s;
proxy_read_timeout 1200s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://10.255.253.85:80;
}
}
server {
listen 80;
server_name frozen-fishbone.104.197.67.227.xip.io;
server_name_in_redirect off;
port_in_redirect off;
location / {
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
proxy_connect_timeout 30s;
proxy_send_timeout 1300s;
proxy_read_timeout 1300s;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://10.255.250.23:80;
}
}
}
stream {
server {
listen 2222;
proxy_connect_timeout 10s;
proxy_timeout 1200s;
proxy_pass 10.255.251.135:2222;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment