|
| 1 | +server { |
| 2 | + listen 80; |
| 3 | + listen [::]:80; |
| 4 | + server_name _; # Use underscore for all IP-based access or replace with actual IP address |
| 5 | + |
| 6 | + # Redirect HTTP to HTTPS (optional, remove if not using HTTPS) |
| 7 | + return 301 https://$host$request_uri; |
| 8 | +} |
| 9 | + |
| 10 | +server { |
| 11 | + listen 443 ssl; |
| 12 | + listen [::]:443 ssl; |
| 13 | + server_name _; # Use underscore for all IP-based access or replace with actual IP address |
| 14 | + |
| 15 | + # SSL configuration (optional, if you're not using SSL with the IP, remove these lines) |
| 16 | + ssl_certificate /etc/letsencrypt/live/subdomain.domain.com/fullchain.pem; |
| 17 | + ssl_certificate_key /etc/letsencrypt/live/subdomain.domain.com/privkey.pem; |
| 18 | + |
| 19 | + client_max_body_size 4G; |
| 20 | + |
| 21 | + location / { |
| 22 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 23 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 24 | + proxy_set_header Host $http_host; |
| 25 | + proxy_redirect off; |
| 26 | + proxy_pass http://merginmaps-web; |
| 27 | + } |
| 28 | + |
| 29 | + location ~ /v1/project/download/ { |
| 30 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 31 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 32 | + proxy_set_header Host $http_host; |
| 33 | + proxy_redirect off; |
| 34 | + proxy_pass http://merginmaps-server:5000; |
| 35 | + |
| 36 | + client_max_body_size 0; |
| 37 | + proxy_http_version 1.1; |
| 38 | + proxy_request_buffering off; |
| 39 | + proxy_buffering off; |
| 40 | + } |
| 41 | + |
| 42 | + location ~ ^/(v1/|v2/|app/|ping|config) { |
| 43 | + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| 44 | + proxy_set_header X-Forwarded-Proto $scheme; |
| 45 | + proxy_set_header Host $http_host; |
| 46 | + proxy_pass http://merginmaps-server:5000; |
| 47 | + } |
| 48 | + |
| 49 | + location /download/ { |
| 50 | + internal; |
| 51 | + alias /data; |
| 52 | + } |
| 53 | +} |
0 commit comments