server { listen 443 ssl; listen [::]:443 ssl; server_name {{ dns_name }}; ssl_certificate /etc/letsencrypt/live/{{ dns_name }}/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/{{ dns_name }}/privkey.pem; location @uwsgi { include uwsgi_params; uwsgi_pass unix:/run/apis-rilec.socket; } location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. alias {{ public_root }}; try_files $uri @uwsgi; } location /media/ { alias {{ public_root }}/media/; } location /static/ { alias {{ public_root }}/static/; } }