mirror of
https://github.com/logos-storage/logos-storage-frontend.git
synced 2026-01-02 13:23:09 +00:00
UPD nginx now redirects calls to codex api
This commit is contained in:
parent
34fc66b7d5
commit
c72ad73aab
@ -12,5 +12,6 @@ RUN yarn build --production
|
|||||||
FROM nginx:stable-alpine
|
FROM nginx:stable-alpine
|
||||||
COPY --from=build-step /frontend/build /usr/share/nginx/html
|
COPY --from=build-step /frontend/build /usr/share/nginx/html
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
COPY deployment/nginx.conf /etc/nginx/conf.d/.conf
|
COPY deployment/nginx.template /etc/nginx/nginx.template
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
@ -1,21 +1,21 @@
|
|||||||
events {}
|
server
|
||||||
http
|
|
||||||
{
|
{
|
||||||
server
|
listen 80;
|
||||||
{
|
server_name localhost;
|
||||||
listen 80;
|
|
||||||
server_name localhost;
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
location /api {
|
error_page 500 502 503 504 /50x.html;
|
||||||
proxy_pass http://localhost:8080;
|
|
||||||
proxy_set_header Host $host;
|
location /api {
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_pass $codex_url;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
}
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
location / {
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
try_files $uri /index.html;
|
}
|
||||||
add_header Cache-Control "no-cache";
|
location / {
|
||||||
}
|
try_files $uri /index.html;
|
||||||
|
add_header Cache-Control "no-cache";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
21
deployment/nginx.template
Normal file
21
deployment/nginx.template
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
server
|
||||||
|
{
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
proxy_pass $codex_url;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
location / {
|
||||||
|
try_files $uri /index.html;
|
||||||
|
add_header Cache-Control "no-cache";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,13 +7,6 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3000:80"
|
- "3000:80"
|
||||||
environment:
|
environment:
|
||||||
- CODEX=http://localhost:8080
|
- codex_url=http://host.docker.internal:8080
|
||||||
|
|
||||||
nginx:
|
|
||||||
image: nginx:alpine
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./deployment/nginx.conf:/etc/nginx/nginx.conf:ro
|
- ./deployment/nginx.template:/etc/nginx/templates/10-variables.conf.template:ro
|
||||||
ports:
|
|
||||||
- "8070:80"
|
|
||||||
depends_on:
|
|
||||||
- client
|
|
||||||
@ -19,7 +19,7 @@ function DebugPage() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
axios
|
axios
|
||||||
.get(
|
.get(
|
||||||
`/api/api/codex/v1/debug/info`,
|
`/api/codex/v1/debug/info`,
|
||||||
{
|
{
|
||||||
headers:
|
headers:
|
||||||
(nodeInfo.auth && {
|
(nodeInfo.auth && {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user