nginx as a reverse proxy -
i'm trying use nginx reverse proxy couple of web applications deployed within docker containers. can expose port 80 docker server, , want allow access shipyard , rabbitmq management web app.
ideally, users access services via: http[:]//10.10.10.1/shipyard/ http[:]//10.10.10.1/rabbitmq/
after quite bit of research, trial , error nginx config:
upstream rabbitmq { server 127.0.0.1:8888; } upstream shipyard { server 127.0.0.1:8080; } server { listen 80; server_name 10.10.10.1; location /rabbitmq/ { proxy_http_version 1.1; 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_set_header upgrade $http_upgrade; proxy_set_header connection 'upgrade'; proxy_set_header host $host; proxy_cache_bypass $http_upgrade; proxy_pass http://rabbitmq/; proxy_redirect default; } location /shipyard/ { proxy_http_version 1.1; 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_set_header upgrade $http_upgrade; proxy_set_header connection 'upgrade'; proxy_set_header host $host; proxy_cache_bypass $http_upgrade; proxy_pass http://shipyard/; proxy_redirect default; } }
when access either path apps run couple of problems, believe maybe related:
shipyard: tries load files http[:]//10.10.10.1/api/containers, when should http[:]//10.10.10.1/shipyard/api/containers
rabbitmq: appears work, until server attempts make restful call: +++ put: http[:]//10.10.10.1/rabbitmq/api/queues///test2 server response 405 (not allowed). @ first thought /// problem, how rabbitmq management application works.
Comments
Post a Comment