-
Notifications
You must be signed in to change notification settings - Fork 159
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 to run ui and api on same port once? #37
Comments
Hey @loongmxbt, thanks for your question! At the moment, this is not a built-in functionality of Show the nginx.confworker_processes auto;
events {}
http {
resolver 127.0.0.11 ipv6=off;
upstream ui {
server host.docker.internal:8051;
}
upstream api {
server host.docker.internal:8080;
}
client_max_body_size 10G;
client_body_timeout 300s;
client_header_timeout 120s;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
# only do relative redirects
absolute_redirect off;
access_log /var/log/nginx/http_access.log combined;
error_log /var/log/nginx/http_error.log;
location ~* "^/(?<endpoint>[a-zA-Z_]+)(?<remaining_part>.*)$" {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_request_headers on;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_store off;
gzip on;
gzip_proxied any;
gzip_types *;
if ($remaining_part !~ ^/(.*)$) {
# add slash to remaining part if it wasn't already added
# required since base path always starts with slash
set $remaining_part /$remaining_part;
}
proxy_pass http://$endpoint$remaining_part$is_args$args;
}
}
}
So, you would start the UI and the API the way to have indicated: opyrator launch-ui conversion:convert
opyrator launch-api conversion:convert and then the nginx proxy for example via Docker: docker run -d --name nginx -p 8090:80 -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf nginx whereas You can then access the UI and API via |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days |
Great framework, really user friendly! Have some suggestions during usage.
Now ui and api need to run with different ports,
Is there a way to run them together
So that I can access
GET /
for ui,GET /docs
for docs,POST /call
for apis.The text was updated successfully, but these errors were encountered: