Some checks are pending
CI / Crawler (Python ${{ matrix.python-version }}) (3.10) (push) Waiting to run
CI / Crawler (Python ${{ matrix.python-version }}) (3.11) (push) Waiting to run
CI / API (Python 3.11) (push) Waiting to run
CI / Database migration (push) Waiting to run
CI / App web build (Node 20) (push) Waiting to run
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
# HTTP -> HTTPS
|
|
server {
|
|
listen 80;
|
|
server_name solorpower.dadot.net;
|
|
|
|
if ($host = solorpower.dadot.net) {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
return 404;
|
|
}
|
|
|
|
# HTTPS application server
|
|
server {
|
|
listen 443 ssl;
|
|
server_name solorpower.dadot.net;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/solorpower.dadot.net/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/solorpower.dadot.net/privkey.pem;
|
|
include /etc/letsencrypt/options-ssl-nginx.conf;
|
|
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
|
|
|
# FastAPI endpoints. Keep this before the SPA fallback.
|
|
location ~ ^/(?:plants(?:/|$)|docs(?:/|$)|redoc(?:/|$)|openapi\.json$|health$) {
|
|
proxy_pass http://127.0.0.1:8000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# React Native Web SPA
|
|
location / {
|
|
root /var/www/html/dist;
|
|
index index.html;
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|