|
| 1 | +server { |
| 2 | + listen 80; |
| 3 | + server_name test.com www.test.com; |
| 4 | + return 301 https://$host$request_uri; |
| 5 | +} |
| 6 | + |
| 7 | +# standalone mode |
| 8 | +server { |
| 9 | + listen 443 ssl; |
| 10 | + http2 on; |
| 11 | + server_name test.com www.test.com; |
| 12 | + ssl_certificate "/etc/nginx/ssl/test.com_ecc/test.com.cer"; # fullchain.cer (recommended) |
| 13 | + ssl_certificate_key "/etc/nginx/ssl/test.com_ecc/test.com.key"; |
| 14 | + ssl_session_cache shared:SSL:1m; |
| 15 | + ssl_session_timeout 10m; |
| 16 | + ssl_ciphers HIGH:!aNULL:!MD5; |
| 17 | + ssl_prefer_server_ciphers on; |
| 18 | + |
| 19 | + # root /usr/share/nginx/html; |
| 20 | + |
| 21 | + location / { |
| 22 | + # root /usr/share/nginx/html; |
| 23 | + # try_files $uri $uri/ /index.html; |
| 24 | + # index index.html index.htm; |
| 25 | + proxy_pass http://blog:3000; # container name is 'blog' |
| 26 | + proxy_set_header Host $http_host; |
| 27 | + proxy_set_header X-Real-IP $remote_addr; |
| 28 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 29 | + } |
| 30 | +} |
| 31 | + |
| 32 | +# export mode |
| 33 | +server { |
| 34 | + # .... |
| 35 | + root /usr/share/nginx/html/jsonq/out; |
| 36 | + |
| 37 | + location / { |
| 38 | + try_files $uri $uri.html $uri/ =404; |
| 39 | + } |
| 40 | + |
| 41 | + # This is necessary when `trailingSlash: false`. |
| 42 | + # You can omit this when `trailingSlash: true`. |
| 43 | + location /blog/ { |
| 44 | + rewrite ^/blog/(.*)$ /blog/$1.html break; |
| 45 | + } |
| 46 | + |
| 47 | + location ^~ /cdn-static/ { |
| 48 | + proxy_pass https://testingcf.jsdelivr.net/gh/json-q/picture-blog@main/; |
| 49 | + } |
| 50 | + |
| 51 | + error_page 404 /404.html; |
| 52 | + location = /404.html { |
| 53 | + internal; |
| 54 | + } |
| 55 | +} |
| 56 | + |
| 57 | +server { |
| 58 | + listen 80; |
| 59 | + server_name minio.test.com www.minio.test.com; |
| 60 | + return 301 https://$host$request_uri; |
| 61 | +} |
| 62 | + |
| 63 | +server { |
| 64 | + #... |
| 65 | + |
| 66 | + location / { |
| 67 | + proxy_pass http://minio:9999; |
| 68 | + proxy_set_header Host $http_host; |
| 69 | + proxy_set_header X-Real-IP $remote_addr; |
| 70 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 71 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 72 | + |
| 73 | + # support websocket |
| 74 | + proxy_http_version 1.1; |
| 75 | + proxy_set_header Upgrade $http_upgrade; |
| 76 | + proxy_set_header Connection "upgrade"; |
| 77 | + } |
| 78 | +} |
| 79 | + |
| 80 | +# img.test.com |
| 81 | +server { |
| 82 | + listen 80; |
| 83 | + server_name img.test.com www.img.test.com; |
| 84 | + return 301 https://$host$request_uri; |
| 85 | +} |
| 86 | + |
| 87 | +server { |
| 88 | + #... |
| 89 | + |
| 90 | + client_max_body_size 50m; |
| 91 | + proxy_buffer_size 128k; |
| 92 | + proxy_buffers 4 256k; |
| 93 | + proxy_busy_buffers_size 256k; |
| 94 | + proxy_temp_file_write_size 512k; |
| 95 | + |
| 96 | + add_header Cache-Control "public, max-age=2592000"; |
| 97 | + location / { |
| 98 | + proxy_pass http://minio:9000; |
| 99 | + proxy_set_header Host $http_host; |
| 100 | + } |
| 101 | +} |
0 commit comments