Answer the question
In order to leave comments, you need to log in
Why is the port not passed?
Hello. There is an Nginx configuration
upstream web {
server web:8083;
}
upstream project {
server web_project:8088;
}
upstream daphne {
server daphne:8001;
}
server {
listen 80;
location /ws/ {
try_files $uri @proxy_to_ws;
}
location /api/v1/project/ {
try_files $uri @proxy_to_project;
}
location / {
try_files $uri @proxy_to_web;
}
location @proxy_to_ws {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_pass http://daphne;
}
location @proxy_to_web {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_pass http://web;
}
location @proxy_to_project {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_pass http://project;
}
location /media {
alias /web/server-static/;
}
location /static {
alias /web/static/;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question