|
1 |
| -server { |
2 |
| - listen 9090; |
| 1 | +worker_processes 1; |
| 2 | +pid /run/nginx.pid; |
| 3 | +error_log /var/log/nginx/error.log; |
| 4 | +include /etc/nginx/modules-enabled/*.conf; |
3 | 5 |
|
4 |
| - server_name localhost; |
| 6 | +events { |
| 7 | + worker_connections 128; |
| 8 | +} |
| 9 | + |
| 10 | +http { |
| 11 | + |
| 12 | + ## |
| 13 | + # Basic Settings |
| 14 | + ## |
| 15 | + |
| 16 | + sendfile on; |
| 17 | + tcp_nopush on; |
| 18 | + types_hash_max_size 2048; |
| 19 | + |
| 20 | + ## |
| 21 | + # Disable unnecessary features |
| 22 | + ## |
| 23 | + |
| 24 | + server_tokens off; |
| 25 | + autoindex off; |
| 26 | + |
| 27 | + include /etc/nginx/mime.types; |
| 28 | + default_type application/octet-stream; |
| 29 | + |
| 30 | + ## |
| 31 | + # Logging Settings |
| 32 | + ## |
| 33 | + |
| 34 | + access_log off; |
| 35 | + error_log /var/log/nginx/error.log; |
| 36 | + |
| 37 | + ## |
| 38 | + # Gzip Settings |
| 39 | + ## |
| 40 | + |
| 41 | + gzip on; |
| 42 | + |
| 43 | + server { |
| 44 | + listen 9090; |
| 45 | + |
| 46 | + server_name localhost; |
5 | 47 |
|
6 |
| - root /var/www/html; |
7 |
| - index index.html; |
| 48 | + add_header X-Frame-Options SAMEORIGIN; |
| 49 | + add_header X-Content-Type-Options nosniff; |
| 50 | + add_header X-XSS-Protection "1; mode=block"; |
8 | 51 |
|
9 |
| - location / { |
10 |
| - try_files $uri /index.html =404; |
11 |
| - } |
| 52 | + root /var/www/html; |
| 53 | + index index.html; |
12 | 54 |
|
13 |
| - # Serve certificates from /app/codegate_volume/certs at /certificates |
14 |
| - location /certificates/codegate_ca.crt { |
15 |
| - alias /app/codegate_volume/certs/ca.crt; |
16 |
| - types { application/x-x509-ca-cert crt; } |
17 |
| - default_type application/x-x509-ca-cert; |
18 |
| - } |
| 55 | + location / { |
| 56 | + try_files $uri /index.html =404; |
| 57 | + expires 1h; # Cache files for 1 hour |
| 58 | + add_header Cache-Control "public, max-age=3600"; |
| 59 | + } |
19 | 60 |
|
20 |
| - error_log /var/log/nginx/error.log; |
21 |
| - access_log /var/log/nginx/access.log; |
| 61 | + # Serve certificates from /app/codegate_volume/certs at /certificates |
| 62 | + location /certificates/codegate_ca.crt { |
| 63 | + alias /app/codegate_volume/certs/ca.crt; |
| 64 | + types { application/x-x509-ca-cert crt; } |
| 65 | + default_type application/x-x509-ca-cert; |
| 66 | + } |
| 67 | + } |
22 | 68 | }
|
0 commit comments