MANALI KHANNA
10/26/2023, 7:12 AMserver {
listen 80 default_server;
server_name localhost:9292;
location / {
rewrite ^(.*)$ /pact$request_uri permanent;
}
location /pact {
proxy_pass <http://localhost:9292>;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Even after mutiple tries, its showing up the broker page on / and /pact is giving a 404. Do I need to change any other configs to configure the web server?Matt (pactflow.io / pact-js / pact-go)
MANALI KHANNA
10/26/2023, 7:30 AMMANALI KHANNA
10/26/2023, 9:35 AMIt is also required when deploying the Broker behind a reverse proxy, and when the application has been mounted at a non-root context. Note that this attribute does not change where the application is actually mounted (that is the concern of the deployment configuration) - it just changes the links.
How do we change the dpeloyment to run as non-root context?Yousaf Nabi (pactflow.io)
Maheswari M
10/26/2023, 2:20 PMversion: "3"
services:
postgres:
image: postgres
healthcheck:
test: psql postgres --command "select 1" -U postgres
volumes:
- postgres-volume:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: postgres
pact-broker:
image: "pactfoundation/pact-broker:2.113.0-pactbroker2.107.1"
ports:
- "9292:9292"
depends_on:
- postgres
environment:
PACT_BROKER_PORT: '9292'
PACT_BROKER_DATABASE_URL: "<postgres://postgres:password@postgres/postgres>"
PACT_BROKER_LOG_LEVEL: DEBUG
PACT_BROKER_SQL_LOG_LEVEL: DEBUG
PACT_BROKER_DATABASE_CONNECT_MAX_RETRIES: "5"
PACT_BROKER_BASE_URL: '<http://localhost:9292/pact>'
pactbroker.base_url: '<http://localhost:9292/pact>'
# Nginx is not necessary, but demonstrates how
# one might use a reverse proxy in front of the broker,
# and includes the use of a self-signed TLS certificate
nginx:
image: nginx:alpine
depends_on:
- pact-broker
volumes:
- ./ssl/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./ssl:/etc/nginx/ssl
ports:
- "443:443"
- "80:80"
volumes:
postgres-volume:
cc: @MANALI KHANNAMatt (pactflow.io / pact-js / pact-go)
<http://localhost/pact> (if port 80) or <https://localhost/pact> for TLSMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
MANALI KHANNA
10/27/2023, 6:19 AMMANALI KHANNA
10/27/2023, 6:20 AMMatt (pactflow.io / pact-js / pact-go)
Do you see anything that we are missing in nginx conf file?this is really an nginx question, it’s been a while and I can’t recall the syntax for doing so