You will get "Bad Gateway 502" error from Nginx in Docker container if you try to fetch transactions by sawtooth-explorer.
To solve your CORS problem to pass http proxy, you need to define port in your nginx.conf file to send the GET request to port of your nginx in Docker container.
For example if your Sawtooth rest-api is connected to port 8024, then you can configure sawtooth-explorer-rest-api-proxy to use also port 8024 in your nginx.conf file to pass http proxy.
Here's an extract from docker-compose.yaml file for rest-api
docker-compose.yaml
rest-api:
image: hyperledger/sawtooth-rest-api:1.0
container_name: supply-rest-api
expose:
- 8008
ports:
- '8024:8008'
depends_on:
- validator
entrypoint: |
sawtooth-rest-api -vv
--connect tcp://validator:4004
--bind rest-api:8008
The sawtooth-explorer has relevant nginx configuration in docker folder.
nginx.conf
server {
listen 8090;
add_header Pragma no-cache always;
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, OPTIONS';
add_header Access-Control-Allow-Headers 'X-XSRF-TOKEN,DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
location / {
#proxy_pass http://localhost:8008;
proxy_pass http://192.168.3.10:8024;
proxy_read_timeout 5000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}