django-tenant-schemas
django-tenant-schemas copied to clipboard
How can I connect django rest tenant schemas application to a frontend framework using Nginx
trafficstars
i want to connect my frontend framework to djano rest tenant schemas using Nginx. How can i go about it? This is what i've done so far
/etc/nginx/conf.d/multitenant.conf
server {
Listen on port 80
listen 80;
server_name ~^(www.)?(?
Redirect all media requests to a directory on the server
location /media { alias /usr/src/app/example_taxi/media; }
~^(www.)?(.+)$;
Redirect any requests to admin, api, or taxi
to the Django server
location ~ /(admin|student|web|fee|api|quiz|nested_admin) { proxy_pass http://dj:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; }
Redirect any other requests to the Angular server
location / { proxy_pass http://ui:4200; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_redirect off; }
}