Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I connect django rest tenant schemas application to a frontend framework using Nginx #654

Open
aisamuel opened this issue Sep 7, 2020 · 0 comments

Comments

@aisamuel
Copy link

aisamuel commented Sep 7, 2020

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;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant