This repository was archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
use nginx for hosting and include reverse proxy features #124
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -406,3 +406,5 @@ cypress/videos | |
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
webapp_provider/public |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
FROM node:lts-alpine | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
RUN apk update && apk upgrade | ||
|
||
# Bundle app source | ||
COPY . . | ||
|
||
EXPOSE 5000 | ||
CMD npx serve -s public | ||
# dockerfile | ||
FROM nginx:latest | ||
RUN apt-get update && apt-get upgrade -y | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY public /var/www/ | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
worker_processes 1; | ||
|
||
events { worker_connections 1024; } | ||
|
||
http { | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
access_log /var/log/nginx/access.log; | ||
sendfile on; | ||
|
||
gzip on; | ||
gzip_comp_level 2; | ||
gzip_min_length 1000; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types text/plain application/x-javascript text/xml text/css application/xml; | ||
|
||
server { | ||
listen 80; | ||
|
||
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-Host $server_name; | ||
|
||
location /api { | ||
# use dockers dns resolver | ||
# with this nginx can start even when the other containers are not running | ||
resolver 127.0.0.11 valid=30s; | ||
set $upstream_rest FileFighterREST; | ||
proxy_pass http://$upstream_rest:8080/api/; | ||
proxy_redirect off; | ||
} | ||
location /data { | ||
client_max_body_size 30G; | ||
resolver 127.0.0.11 valid=30s; | ||
set $upstream_Filehandler FileFighterFileHandler; | ||
proxy_pass http://$upstream_Filehandler:5000/data; | ||
proxy_redirect off; | ||
} | ||
|
||
location / { | ||
root /var/www; | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we need to add default timeouts and upload body size. otherwise users cannot upload large files right?