You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Django app is called by Nginx, which behaves as a reverse proxy to client requests. Here is the nginx configuration file:
# HTTP configuration
# Default HTTP server: always redirect to HTTPS
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
# HTTPS server
server {
listen 443;
server_name search-api.het.io;
if ( $http_host !~* ^(search-api\.het\.io)$ ) {
return 444;
}
ssl on;
ssl_certificate /etc/letsencrypt/live/search-api.het.io/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/search-api.het.io/privkey.pem; # managed by Certbot
charset utf-8;
# max upload size (adjust to taste)
client_max_body_size 10M;
location / {
return 301 $scheme://$host/v1;
}
location /static {
alias /home/ubuntu/hetmech-backend/dj_hetmech/static;
}
location /v1 {
proxy_pass http://127.0.0.1:8001/v1;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
}
The directory /home/ubuntu/hetmech-backend/dj_hetmech/static (which holds static files for API view) should be populated by the following management command:
python manage.py collectstatic
Gunicorn is started at boot time by supervisord, with the following configuration:
This is helpful to jot down. Hopefully, in the medium term, we can design a solution that produces the server instance in an entirely scripted way. One solution that comes to mind is for this repository to define a Docker image with its environment. This image could be built / deployed by CI as necessary. @dongbohu interested to hear what you think is the best solution?
For now I can write a shell script to keep track of all deployment steps. Then if we (or users of this repo) need to deploy the backend, all they need to do is run this script on either docker container or cloud instances such as AWS EC2 or Google Cloud etc.
This Django app is called by Nginx, which behaves as a reverse proxy to client requests. Here is the nginx configuration file:
The directory
/home/ubuntu/hetmech-backend/dj_hetmech/static
(which holds static files for API view) should be populated by the following management command:Gunicorn is started at boot time by supervisord, with the following configuration:
The text was updated successfully, but these errors were encountered: