|
| 1 | +apiVersion: v1 |
| 2 | +kind: ConfigMap |
| 3 | +metadata: |
| 4 | + name: {{ template "matomo.fullname" . }} |
| 5 | + labels: |
| 6 | + app: {{ template "matomo.name" . }} |
| 7 | + chart: {{ template "matomo.chart" . }} |
| 8 | + release: {{ .Release.Name }} |
| 9 | + heritage: {{ .Release.Service }} |
| 10 | +data: |
| 11 | + nginx.conf: | |
| 12 | + # nginx.conf for php |
| 13 | + events { |
| 14 | + worker_connections 768; |
| 15 | + } |
| 16 | +
|
| 17 | + http { |
| 18 | + upstream backend { |
| 19 | + server localhost:9000; |
| 20 | + } |
| 21 | +
|
| 22 | + include /etc/nginx/mime.types; |
| 23 | + default_type application/octet-stream; |
| 24 | + gzip on; |
| 25 | + gzip_disable "msie6"; |
| 26 | +
|
| 27 | + # If we receive X-Forwarded-Proto, pass it through; otherwise, pass along the |
| 28 | + # scheme used to connect to this server |
| 29 | + map $http_x_forwarded_proto $proxy_x_forwarded_proto { |
| 30 | + default $http_x_forwarded_proto; |
| 31 | + '' $scheme; |
| 32 | + } |
| 33 | + # If we receive X-Forwarded-Port, pass it through; otherwise, pass along the |
| 34 | + # server port the client connected to |
| 35 | + map $http_x_forwarded_port $proxy_x_forwarded_port { |
| 36 | + default $http_x_forwarded_port; |
| 37 | + '' $server_port; |
| 38 | + } |
| 39 | + # If we receive Upgrade, set Connection to "upgrade"; otherwise, delete any |
| 40 | + # Connection header that may have been passed to this server |
| 41 | + map $http_upgrade $proxy_connection { |
| 42 | + default upgrade; |
| 43 | + '' close; |
| 44 | + } |
| 45 | + # Set appropriate X-Forwarded-Ssl header |
| 46 | + map $scheme $proxy_x_forwarded_ssl { |
| 47 | + default off; |
| 48 | + https on; |
| 49 | + } |
| 50 | + # HTTP 1.1 support |
| 51 | + proxy_http_version 1.1; |
| 52 | + proxy_buffering off; |
| 53 | + proxy_set_header Host $http_host; |
| 54 | + proxy_set_header Upgrade $http_upgrade; |
| 55 | + proxy_set_header Connection $proxy_connection; |
| 56 | + proxy_set_header X-Real-IP $remote_addr; |
| 57 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 58 | + proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto; |
| 59 | + proxy_set_header X-Forwarded-Ssl $proxy_x_forwarded_ssl; |
| 60 | + proxy_set_header X-Forwarded-Port $proxy_x_forwarded_port; |
| 61 | + proxy_set_header Proxy ""; |
| 62 | +
|
| 63 | + server { |
| 64 | + listen 80; |
| 65 | +
|
| 66 | + root /var/www/html/; |
| 67 | + index index.php index.html index.htm; |
| 68 | +
|
| 69 | + location / { |
| 70 | + try_files $uri $uri/ =404; |
| 71 | + } |
| 72 | +
|
| 73 | + error_page 404 /404.html; |
| 74 | + error_page 500 502 503 504 /50x.html; |
| 75 | + location = /50x.html { |
| 76 | + root /usr/share/nginx/html; |
| 77 | + } |
| 78 | +
|
| 79 | + location = /favicon.ico { |
| 80 | + log_not_found off; |
| 81 | + access_log off; |
| 82 | + } |
| 83 | +
|
| 84 | + location ~ \.php$ { |
| 85 | + fastcgi_param GATEWAY_INTERFACE CGI/1.1; |
| 86 | + fastcgi_param SERVER_SOFTWARE nginx; |
| 87 | + fastcgi_param QUERY_STRING $query_string; |
| 88 | + fastcgi_param REQUEST_METHOD $request_method; |
| 89 | + fastcgi_param CONTENT_TYPE $content_type; |
| 90 | + fastcgi_param CONTENT_LENGTH $content_length; |
| 91 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 92 | + fastcgi_param SCRIPT_NAME $fastcgi_script_name; |
| 93 | + fastcgi_param REQUEST_URI $request_uri; |
| 94 | + fastcgi_param DOCUMENT_URI $document_uri; |
| 95 | + fastcgi_param DOCUMENT_ROOT $document_root; |
| 96 | + fastcgi_param SERVER_PROTOCOL $server_protocol; |
| 97 | + fastcgi_param REMOTE_ADDR $remote_addr; |
| 98 | + fastcgi_param REMOTE_PORT $remote_port; |
| 99 | + fastcgi_param SERVER_ADDR $server_addr; |
| 100 | + fastcgi_param SERVER_PORT $server_port; |
| 101 | + fastcgi_param SERVER_NAME $server_name; |
| 102 | + fastcgi_intercept_errors on; |
| 103 | + fastcgi_pass backend; |
| 104 | + } |
| 105 | + } |
| 106 | + } |
0 commit comments