--- apiVersion: v1 kind: ConfigMap metadata: name: web-configuration data: nginx.conf: | user www-data; worker_processes 6; pid /run/nginx.pid; events { worker_connections 10000; use epoll; multi_accept on; } http { set_real_ip_from 10.0.0.0/8; ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 0; types_hash_max_size 2048; server_tokens off; limit_conn_zone $binary_remote_addr zone=addr:10m; server_names_hash_bucket_size 64; server_name_in_redirect off; fastcgi_buffer_size 256k; fastcgi_buffers 4 256k; client_body_buffer_size 1024k; client_max_body_size 20m; client_header_buffer_size 1024k; large_client_header_buffers 16 1024k; default_type application/octet-stream; include /etc/nginx/mime.types; ## # SSL Settings ## ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; rewrite_log on; ## # Gzip Settings ## 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 text/xml application/xml application/xml+rss text/javascript; ## # Virtual Host Configs ## server { listen 80 default; server_name _ ; root /app/web; index index.php; keepalive_timeout 70; client_body_temp_path /nginx-tmp 1 2; client_body_timeout 22s; client_header_timeout 22s; limit_conn addr 10000; location ~ /\.(git) { deny all; } location / { add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; add_header X-XSS-Protection "1; mode=block"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; add_header Permissions-Policy "browsing-topics=()" always; # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php?$args; # uncomment to avoid processing of calls to non-existing static files by Yii #location ~* \.(js|css|png|jpg|gif|ico|pdf|mov|fla|zip|rar)$ { location ~* \.(js|css|png|jpg|gif|ico)$ { expires 30d; add_header Vary Accept-Encoding; add_header Pragma "public"; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; access_log off; tcp_nodelay off; try_files $uri $uri/ /index.php?$args; open_file_cache max=3000 inactive=120s; open_file_cache_valid 45s; open_file_cache_min_uses 2; open_file_cache_errors off; } #error_page 404 /404.html; } location ~ \.php$ { add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; add_header X-XSS-Protection "1; mode=block"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-Content-Type-Options "nosniff"; fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } fastcgi_pass localhost:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; include fastcgi_params; fastcgi_read_timeout 20s; fastcgi_connect_timeout 60s; fastcgi_send_timeout 60s; } } }