2022-03-01 00:17:29 +00:00
|
|
|
# replace example.tld with your domain
|
2022-03-01 00:48:20 +00:00
|
|
|
# replace /location/to with the location
|
2022-03-01 00:17:29 +00:00
|
|
|
|
|
|
|
server {
|
|
|
|
#listen 80 is default
|
|
|
|
server_name www.example.tld;
|
|
|
|
return 301 $scheme://example.tld$request_uri;
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2022-03-05 01:28:39 +00:00
|
|
|
add_header Access-Control-Allow-Origin *;
|
2022-03-01 00:17:29 +00:00
|
|
|
listen 80;
|
|
|
|
server_name example.tld www.example.tld;
|
2022-03-05 01:28:39 +00:00
|
|
|
root /location/to/zer0bin/frontend/dist;
|
|
|
|
index index.html;
|
2022-03-01 00:17:29 +00:00
|
|
|
location ^~ /.well-known/ {
|
|
|
|
alias /var/www/.well-known/;
|
|
|
|
}
|
|
|
|
location /api/ {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2022-03-05 01:28:39 +00:00
|
|
|
add_header Access-Control-Allow-Origin *;
|
|
|
|
listen 443 ssl;
|
2022-03-01 00:17:29 +00:00
|
|
|
server_name example.tld www.example.tld;
|
2022-03-05 01:28:39 +00:00
|
|
|
root /location/to/zer0bin/frontend/dist;
|
|
|
|
index index.html;
|
2022-03-01 00:17:29 +00:00
|
|
|
location ^~ /.well-known/ {
|
|
|
|
alias /var/www/.well-known/;
|
|
|
|
}
|
|
|
|
location /api/ {
|
|
|
|
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-05 01:28:39 +00:00
|
|
|
#ssl_certificate /etc/letsencrypt/live/example.tld/fullchain.pem;
|
|
|
|
#ssl_certificate_key /etc/letsencrypt/live/example.tld/privkey.pem;
|
|
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
|
|
ssl_prefer_server_ciphers on;
|
2022-03-01 00:17:29 +00:00
|
|
|
}
|