fix: corrige URL da API no frontend e adiciona suporte a WebSockets no Nginx
This commit is contained in:
parent
b3237187bc
commit
2214f04a8a
2 changed files with 19 additions and 4 deletions
|
|
@ -45,7 +45,7 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
- NEXT_PUBLIC_API_URL=https://api-ghj.rede5.com.br/api/v1
|
- NEXT_PUBLIC_API_URL=https://api-ghj.rede5.com.br
|
||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
volumes:
|
volumes:
|
||||||
- ./frontend:/app
|
- ./frontend:/app
|
||||||
|
|
|
||||||
21
nginx.conf
21
nginx.conf
|
|
@ -3,12 +3,24 @@ server {
|
||||||
server_name ghj.rede5.com.br;
|
server_name ghj.rede5.com.br;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://172.18.0.4:3000;
|
proxy_pass http://127.0.0.1:3000;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection 'upgrade';
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_cache_bypass $http_upgrade;
|
proxy_cache_bypass $http_upgrade;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
# HMR (Hot Module Replacement)
|
||||||
|
location /_next/webpack-hmr {
|
||||||
|
proxy_pass http://127.0.0.1:3000/_next/webpack-hmr;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $host;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -17,11 +29,14 @@ server {
|
||||||
server_name api-ghj.rede5.com.br;
|
server_name api-ghj.rede5.com.br;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://172.18.0.3:8521;
|
proxy_pass http://127.0.0.1:8521;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection 'upgrade';
|
proxy_set_header Connection 'upgrade';
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_cache_bypass $http_upgrade;
|
proxy_cache_bypass $http_upgrade;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue