У меня есть docker-compose с контейнерами Liberty и nginx, но я получаю сообщение об ошибке 404 из запроса nginx. У меня есть
Пример: URL API Liberty: http://localhost:9082/sxrw-main/api/v1/terminals
URL nginx: http://localhost:81/sxrw-main/api/v1/terminals ошибка 404
docker-compose
version: "3"
services:
ship-api:
image: docker.csx.com/websphere-liberty:javaee8
volumes:
- ./dist/config:/config
- ./dist/shared:/opt/ibm/wlp/usr/shared
ports:
- 9082:9080
- 944:9443
ship-web:
image: docker.csx.com/nginx:latest
ports:
- "81:80"
volumes:
- ./html:/usr/share/nginx/html
- ./nginx.conf:/etc/nginx/nginx.conf
links:
- ship-api
networks:
- shipcsx
networks:
shipcsx:
driver: bridge
Вот мой файл nginx.conf
events {
worker_connections 1024;
}
http {
server {
listen 80;
location /sxrw-main/api {
proxy_pass http://ship-api:9082;
}
}
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}