CORS setup for docker-compose config with new frontend (#7841)

* CORS setup for docker-compose with new frontend

* Add NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL=ws for docker compose with new frontend
pull/7843/head
Victor Baranov 1 year ago committed by GitHub
parent be743ff089
commit e24116988c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 5
      docker-compose/envs/common-frontend.env
  3. 51
      docker-compose/proxy/nginx.conf
  4. 2
      docker-compose/services/docker-compose-nginx.yml

@ -15,6 +15,7 @@
### Chore
- [#7841](https://github.com/blockscout/blockscout/pull/7841) - CORS setup for docker-compose config with new frontend
- [#7832](https://github.com/blockscout/blockscout/pull/7832) - API v2: Add block_number to logs
- [#7789](https://github.com/blockscout/blockscout/pull/7789) - Fix test warnings; Fix name of `MICROSERVICE_ETH_BYTECODE_DB_INTERVAL_BETWEEN_LOOKUPS` env variable
- [#7819](https://github.com/blockscout/blockscout/pull/7819) - Add logging for unknown error verification result

@ -1,7 +1,7 @@
NEXT_PUBLIC_API_HOST=localhost
NEXT_PUBLIC_STATS_API_HOST=http://localhost
NEXT_PUBLIC_API_PORT=80
NEXT_PUBLIC_API_PORT=81
NEXT_PUBLIC_API_PROTOCOL=http
NEXT_PUBLIC_STATS_API_HOST=http://localhost:82
NEXT_PUBLIC_NETWORK_NAME=Göerli
NEXT_PUBLIC_NETWORK_SHORT_NAME=Göerli
NEXT_PUBLIC_NETWORK_ASSETS_PATHNAME=ethereum
@ -23,3 +23,4 @@ NEXT_PUBLIC_NETWORK_LOGO=https://raw.githubusercontent.com/blockscout/frontend-c
NEXT_PUBLIC_NETWORK_ICON=https://raw.githubusercontent.com/blockscout/frontend-configs/main/configs/network-icons/goerli.svg
NEXT_PUBLIC_HOMEPAGE_PLATE_GRADIENT="radial-gradient(103.03% 103.03% at 0% 0%, rgba(183, 148, 244, 0.8) 0%, rgba(0, 163, 196, 0.8) 100%)"
NEXT_PUBLIC_HOMEPAGE_PLATE_TEXT_COLOR="rgb(255, 255, 255)"
NEXT_PUBLIC_API_WEBSOCKET_PROTOCOL='ws'

@ -5,17 +5,52 @@ server {
location / {
proxy_pass http://frontend:3000;
}
location /api/v2 {
proxy_pass http://backend:4000/api/v2;
location /socket/v2 {
proxy_pass http://backend:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
location /api/account/v1 {
proxy_pass http://backend:4000/api/account/v1;
location /api/ {
proxy_pass http://backend:4000/api;
}
location /api/v1/counters {
proxy_pass http://stats:8050/api/v1/counters;
}
location /api/v1/lines {
proxy_pass http://stats:8050/api/v1/lines;
server {
listen 81;
server_name localhost;
proxy_http_version 1.1;
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header Access-Control-Allow-Methods;
add_header 'Access-Control-Allow-Origin' 'http://localhost' always;
add_header 'Access-Control-Allow-Methods' 'PUT, GET, POST, OPTIONS, DELETE, PATCH' always;
location / {
proxy_pass http://backend:4000;
}
location /socket {
proxy_pass http://backend:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
}
server {
listen 82;
server_name localhost;
proxy_http_version 1.1;
proxy_hide_header Access-Control-Allow-Origin;
proxy_hide_header Access-Control-Allow-Methods;
add_header 'Access-Control-Allow-Origin' 'http://localhost' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Access-Control-Allow-Methods' 'PUT, GET, POST, OPTIONS, DELETE, PATCH' always;
location / {
proxy_pass http://stats:8050;
}
location /socket/v2 {
proxy_pass http://backend:4000;

@ -10,3 +10,5 @@ services:
read_only: true
ports:
- 80:80
- 81:81
- 82:82
Loading…
Cancel
Save