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
|
||||
COPY --from=build-step /frontend/build /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
COPY deployment/nginx.conf /etc/nginx/conf.d/.conf
|
||||
COPY deployment/nginx.template /etc/nginx/nginx.template
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@ -1,21 +1,21 @@
|
||||
events {}
|
||||
http
|
||||
server
|
||||
{
|
||||
server
|
||||
{
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location /api {
|
||||
proxy_pass http://localhost:8080;
|
||||
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";
|
||||
}
|
||||
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";
|
||||
}
|
||||
}
|
||||
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:
|
||||
- "3000:80"
|
||||
environment:
|
||||
- CODEX=http://localhost:8080
|
||||
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
- codex_url=http://host.docker.internal:8080
|
||||
volumes:
|
||||
- ./deployment/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
ports:
|
||||
- "8070:80"
|
||||
depends_on:
|
||||
- client
|
||||
- ./deployment/nginx.template:/etc/nginx/templates/10-variables.conf.template:ro
|
||||
@ -19,7 +19,7 @@ function DebugPage() {
|
||||
useEffect(() => {
|
||||
axios
|
||||
.get(
|
||||
`/api/api/codex/v1/debug/info`,
|
||||
`/api/codex/v1/debug/info`,
|
||||
{
|
||||
headers:
|
||||
(nodeInfo.auth && {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user