|
| 1 | +user nginx; |
| 2 | +worker_processes auto; |
| 3 | + |
| 4 | +error_log /var/log/nginx/error.log warn; |
| 5 | + |
| 6 | +events { |
| 7 | + worker_connections 1024; |
| 8 | +} |
| 9 | + |
| 10 | +http { |
| 11 | + server_tokens off; |
| 12 | + absolute_redirect off; |
| 13 | + access_log /var/log/nginx/access.log; |
| 14 | + default_type application/octet-stream; |
| 15 | + error_log /var/log/nginx/error.log; |
| 16 | + include /etc/nginx/mime.types; |
| 17 | + keepalive_timeout 3000; |
| 18 | + sendfile on; |
| 19 | + |
| 20 | + server { |
| 21 | + listen 8080; |
| 22 | + root /usr/share/nginx/html; |
| 23 | + index index.html; |
| 24 | + server_name_in_redirect on; |
| 25 | + |
| 26 | + add_header Referrer-Policy "no-referrer" always; |
| 27 | + add_header X-XSS-Protection "0" always; |
| 28 | + add_header X-Frame-Options "deny" always; |
| 29 | + add_header X-Content-Type-Options "nosniff" always; |
| 30 | + add_header Content-Security-Policy "default-src 'self'; base-uri 'self'; font-src 'self' https: data:; form-action 'self'; frame-ancestors 'self'; img-src 'self' data: https://*.openstreetmap.org https://jedonnemonavis.numerique.gouv.fr; object-src 'none'; script-src 'self' https: 'unsafe-inline' 'unsafe-eval'; script-src-attr 'none'; style-src 'self' https: 'unsafe-inline'; connect-src 'self' https:; worker-src 'self' blob:;" always; |
| 31 | + |
| 32 | + charset utf-8; |
| 33 | + |
| 34 | + gzip on; |
| 35 | + gzip_disable "msie6"; |
| 36 | + gzip_vary on; |
| 37 | + gzip_proxied any; |
| 38 | + gzip_comp_level 6; |
| 39 | + gzip_buffers 16 8k; |
| 40 | + gzip_http_version 1.1; |
| 41 | + gzip_min_length 256; |
| 42 | + gzip_types text/css application/json application/javascript application/x-javascript text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; |
| 43 | + |
| 44 | + client_max_body_size 32m; |
| 45 | + error_page 500 502 503 504 /50x.html; |
| 46 | + |
| 47 | + location / { |
| 48 | + try_files $uri $uri.html $uri/index.html $uri/ /index.html; |
| 49 | + } |
| 50 | + |
| 51 | + location /50x.html { |
| 52 | + root /var/lib/nginx/html; |
| 53 | + } |
| 54 | + |
| 55 | + location /live { |
| 56 | + default_type text/plain; |
| 57 | + return 200 'OK'; |
| 58 | + } |
| 59 | + |
| 60 | + include /etc/nginx/ready_response.conf; |
| 61 | + location /ready { |
| 62 | + default_type text/plain; |
| 63 | + if ($ready_response = 'OK') { |
| 64 | + return 200 $ready_response; |
| 65 | + } |
| 66 | + return 500 'Not Ready'; |
| 67 | + } |
| 68 | + } |
| 69 | +} |
0 commit comments