Created
January 19, 2017 09:48
-
-
Save vmakhaev/b0caef4361907cd733279823b2002d52 to your computer and use it in GitHub Desktop.
Nginx as controller for kube-dns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; ## Default: 1024 | |
} | |
http { | |
gzip on; | |
gzip_disable "msie6"; | |
gzip_vary on; | |
gzip_proxied any; | |
gzip_comp_level 6; | |
gzip_buffers 16 8k; | |
gzip_http_version 1.1; | |
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; | |
client_body_buffer_size 10K; | |
client_header_buffer_size 1k; | |
client_max_body_size 10m; | |
large_client_header_buffers 4 8k; | |
client_body_timeout 12; | |
client_header_timeout 12; | |
keepalive_timeout 15; | |
send_timeout 10; | |
keepalive_requests 1000; | |
# websockets timeout | |
proxy_read_timeout 950s; | |
server { | |
listen 80; | |
server_name onlyssl.domain.com; | |
location / { | |
return 301 https://$http_host$request_uri; | |
} | |
} | |
server { | |
listen 443 ssl; | |
server_name ~^(www\.)?(?<subdomain>.+)\.domain\.com$; | |
ssl_certificate /etc/nginx/certs/domain.com.crt; | |
ssl_certificate_key /etc/nginx/certs/domain.com.key; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 5m; | |
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !EXPORT !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"; | |
ssl_prefer_server_ciphers on; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
location /channel { | |
resolver 10.0.0.10; | |
proxy_pass http://$subdomain.default.svc.cluster.local; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
} | |
location / { | |
resolver 10.0.0.10; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $host; | |
proxy_pass http://$subdomain.default.svc.cluster.local; | |
proxy_redirect off; | |
} | |
} | |
server { | |
listen 80; | |
server_name ~^(www\.)?(?<subdomain>.+)\.domain\.com$; | |
location / { | |
resolver 10.0.0.10; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $host; | |
proxy_pass http://$subdomain.default.svc.cluster.local; | |
proxy_redirect off; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment