-
-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes Demo https://martin.maplibre.org/ site (the new code is already in production there). Main fixes: * uses HTTPS again, just like the previous site * uses nginx * fixes all the relative paths, maplibre, minor other things
- Loading branch information
Showing
11 changed files
with
138 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
*Dockerfile | ||
.dockerignore | ||
.vscode | ||
|
||
### Node template | ||
# Logs | ||
logs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM node:alpine as builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package.json . | ||
COPY yarn.lock . | ||
RUN yarn install | ||
|
||
COPY . . | ||
RUN yarn run build | ||
|
||
CMD ["yarn", "run", "preview"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
user nginx; | ||
worker_processes auto; | ||
worker_cpu_affinity auto; | ||
pid /run/nginx.pid; | ||
|
||
events { | ||
worker_connections 4086; | ||
use epoll; | ||
multi_accept on; | ||
} | ||
|
||
http { | ||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
keepalive_requests 1000; | ||
types_hash_max_size 2048; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
|
||
gzip on; | ||
gzip_vary on; | ||
gzip_proxied any; | ||
gzip_comp_level 6; | ||
gzip_buffers 16 8k; | ||
gzip_http_version 1.1; | ||
gzip_min_length 256; | ||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml | ||
application/javascript application/json application/x-protobuf; | ||
|
||
proxy_cache_path /var/cache/nginx/ | ||
levels=1:2 | ||
max_size=10g | ||
inactive=60m | ||
use_temp_path=off | ||
keys_zone=backend_cache:10m; | ||
|
||
upstream tiles_upstream { | ||
server tiles:3000; | ||
} | ||
|
||
server { | ||
# listen 80; | ||
listen 443 ssl default_server; | ||
listen [::]:443 ssl default_server; | ||
|
||
ssl_certificate /etc/ssl/certs/cert.pem; | ||
ssl_certificate_key /etc/ssl/certs/private.pem; | ||
|
||
server_name localhost martin.maplibre.org maplibre.org cloudflare.com; | ||
resolver 127.0.0.1; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
try_files $uri /index.html; | ||
} | ||
|
||
location ~ /tiles/(?<fwd_path>.*) { | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Forwarded-Proto "https"; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $host; | ||
proxy_set_header X-Rewrite-URL $uri; | ||
proxy_redirect off; | ||
|
||
proxy_connect_timeout 5m; | ||
proxy_send_timeout 5m; | ||
proxy_read_timeout 5m; | ||
send_timeout 5m; | ||
|
||
proxy_cache backend_cache; | ||
proxy_cache_lock on; | ||
proxy_cache_revalidate on; | ||
proxy_cache_valid 200 204 302 1d; | ||
proxy_cache_valid 404 1m; | ||
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; | ||
add_header X-Cache-Status $upstream_cache_status; | ||
|
||
proxy_pass http://tiles_upstream/$fwd_path$is_args$args; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.