1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,71 @@ |
1 |
+user www-data; |
|
2 |
+worker_processes auto; |
|
3 |
+pid /run/nginx.pid; |
|
4 |
+include /etc/nginx/modules-enabled/*.conf; |
|
5 |
+ |
|
6 |
+events { |
|
7 |
+ worker_connections 768; |
|
8 |
+ # multi_accept on; |
|
9 |
+} |
|
10 |
+ |
|
11 |
+http { |
|
12 |
+ proxy_cache_path /tmp/maps-osm/ levels=1:2 keys_zone=osm_cache:100m max_size=10g inactive=60d; |
|
13 |
+ proxy_cache_path /tmp/maps-satellite/ levels=1:2 keys_zone=satellite_cache:100m max_size=9g inactive=90d; |
|
14 |
+ proxy_cache_path /tmp/maps-nexrad/ levels=1:2 keys_zone=nexrad_cache:10m max_size=1g inactive=1h; |
|
15 |
+ |
|
16 |
+ server { |
|
17 |
+ listen 80; |
|
18 |
+ server_name _; |
|
19 |
+ |
|
20 |
+ location ~ ^/osm/tiles/ { |
|
21 |
+ rewrite ^/osm/tiles/(.*)$ /styles/v1/mapbox/streets-v11/tiles/$1?access_token=MAPBOX-ACCESS-TOKEN-HERE break; |
|
22 |
+ proxy_ssl_server_name on; |
|
23 |
+ proxy_pass https://api.mapbox.com; |
|
24 |
+ proxy_cache osm_cache; |
|
25 |
+ proxy_cache_valid 200 302 304 30d; |
|
26 |
+ proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; |
|
27 |
+ proxy_cache_background_update on; |
|
28 |
+ add_header X-Proxy-Cache $upstream_cache_status; |
|
29 |
+ expires 30d; |
|
30 |
+ } |
|
31 |
+ |
|
32 |
+ location ~ ^/satellite/tiles/ { |
|
33 |
+ rewrite ^/satellite/tiles/(.*)$ /styles/v1/mapbox/satellite-v9/tiles/$1?access_token=MAPBOX-ACCESS-TOKEN-HERE break; |
|
34 |
+ proxy_ssl_server_name on; |
|
35 |
+ proxy_pass https://api.mapbox.com; |
|
36 |
+ proxy_cache satellite_cache; |
|
37 |
+ proxy_cache_valid 200 302 304 90d; |
|
38 |
+ proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; |
|
39 |
+ proxy_cache_background_update on; |
|
40 |
+ add_header X-Proxy-Cache $upstream_cache_status; |
|
41 |
+ expires 30d; |
|
42 |
+ } |
|
43 |
+ |
|
44 |
+ location ~ ^/nexrad/ { |
|
45 |
+ rewrite ^/nexrad/(.*)$ /cgi-bin/wms/nexrad/n0q.cgi$is_args$args break; |
|
46 |
+ proxy_ssl_server_name on; |
|
47 |
+ proxy_pass http://mesonet.agron.iastate.edu; |
|
48 |
+ proxy_cache nexrad_cache; |
|
49 |
+ proxy_cache_valid 200 302 304 5m; |
|
50 |
+ proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; |
|
51 |
+ proxy_cache_background_update on; |
|
52 |
+ add_header X-Proxy-Cache $upstream_cache_status; |
|
53 |
+ expires 30d; |
|
54 |
+ } |
|
55 |
+ |
|
56 |
+ location / { |
|
57 |
+ root /var/www/; |
|
58 |
+ index index.html index.php; |
|
59 |
+ |
|
60 |
+ error_page 404 = /index.php; |
|
61 |
+ try_files $uri $uri/ index.php =404; |
|
62 |
+ |
|
63 |
+ location ~ \.php$ { |
|
64 |
+ include /etc/nginx/fastcgi_params; |
|
65 |
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
|
66 |
+ fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; |
|
67 |
+ } |
|
68 |
+ } |
|
69 |
+ } |
|
70 |
+} |
|
71 |
+ |