Skip to content

Commit

Permalink
Add nginx proxy
Browse files Browse the repository at this point in the history
GeekLogan committed Aug 14, 2024
1 parent 068f106 commit a38172c
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -38,7 +38,11 @@ ENV PUBLIC_URL=http://localhost
ENV DATASET_ID=packed2

ENV PATH=/root/.local/bin:$PATH
RUN apt-get update && apt-get install -y --no-install-recommends libx264-dev
RUN apt-get update && apt-get install -y --no-install-recommends libx264-dev
RUN apt-get install nginx

COPY nginx.conf /etc/nginx/sites-available/default

COPY backend /app
#COPY --from=db-builder /app/a.out /app/db-server
COPY --from=backend-builder /app/algorithm/astar/*.so ./app/algorithm/astar/
@@ -51,5 +55,6 @@ WORKDIR /app

EXPOSE 8085
EXPOSE 8050
EXPOSE 80

CMD ["python", "main.py"]
12 changes: 12 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
server {
listen 80;
server_name localhost;

location / {
proxy_pass https://ntracer2.cai-lab.org/data2/; # The server to which requests are proxied
proxy_set_header Host $host; # Forward the original Host header
proxy_set_header X-Real-IP $remote_addr; # Forward the client’s IP address
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Forward the IP address chain
proxy_set_header X-Forwarded-Proto $scheme; # Forward the original protocol (HTTP/HTTPS)
}
}

0 comments on commit a38172c

Please sign in to comment.