2022-03-01 00:17:29 +00:00
|
|
|
# replace example.tld with your domain
|
2022-03-16 05:20:44 +00:00
|
|
|
# replace /home/the1calc/zer0bin with the location of the zer0bin folder
|
2022-03-01 00:17:29 +00:00
|
|
|
|
|
|
|
server {
|
|
|
|
#listen 80 is default
|
|
|
|
server_name www.example.tld;
|
2022-03-13 22:37:16 +00:00
|
|
|
return 301 https://example.tld$request_uri;
|
2022-03-16 05:20:44 +00:00
|
|
|
brotli on;
|
2022-03-01 00:17:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2022-03-16 05:20:44 +00:00
|
|
|
listen 443;
|
2022-03-13 21:48:40 +00:00
|
|
|
server_name example.tld;
|
2022-03-16 05:20:44 +00:00
|
|
|
brotli on;
|
2022-03-13 21:48:40 +00:00
|
|
|
|
2022-03-16 05:20:44 +00:00
|
|
|
root /location/of/zer0bin/frontend/dist;
|
2022-03-13 21:48:40 +00:00
|
|
|
|
|
|
|
rewrite ^/~/(.*)$ /index.html;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
index index.html;
|
|
|
|
}
|
|
|
|
|
|
|
|
location ~ \.(css|js|html) {
|
|
|
|
try_files $uri =404;
|
|
|
|
}
|
|
|
|
|
2022-03-01 00:17:29 +00:00
|
|
|
location ^~ /.well-known/ {
|
|
|
|
alias /var/www/.well-known/;
|
2022-03-13 21:48:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
location /api/ {
|
2022-03-01 00:17:29 +00:00
|
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
|
|
|
add_header 'Access-Control-Allow-Origin' '*';
|
|
|
|
proxy_pass http://localhost:8000/;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
}
|
2022-03-13 21:48:40 +00:00
|
|
|
|
2022-03-16 05:32:43 +00:00
|
|
|
expires 30d;
|
|
|
|
add_header Cache-Control "public, no-transform";
|
2022-03-13 21:48:40 +00:00
|
|
|
|
2022-03-16 05:20:44 +00:00
|
|
|
# If you have SSL certs from letsencrypt via certbot, uncomment the below lines:
|
2022-03-16 05:35:06 +00:00
|
|
|
|
2022-03-16 05:32:43 +00:00
|
|
|
# ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
|
|
|
|
# ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
|
|
|
|
}
|