Open aisamuel opened 3 years ago
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
server {
listen 80; server_name ~^(www.)?(?.+)$;
location /media { alias /usr/src/app/example_taxi/media; }
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; }
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; }
}
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; }
}