Skip to content

Instantly share code, notes, and snippets.

@Soyuzbek
Last active January 15, 2021 03:02
Show Gist options
  • Save Soyuzbek/811288d03aa78133e13bdc99f9a9c4a7 to your computer and use it in GitHub Desktop.
Save Soyuzbek/811288d03aa78133e13bdc99f9a9c4a7 to your computer and use it in GitHub Desktop.
Configuration file for django api & vue spa server
server {
listen 80;
server_name your.ip.address.or.domain.name;
root /var/www/project_name/;
location / {
try_files /static/index.html =404;
}
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
alias /var/www/project_name/static/;
}
location /api/ {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
location /admin/ {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment