Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PB138 - Film Database Group Project
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tomáš Havlíček
PB138 - Film Database Group Project
Commits
83eec146
There was an error fetching the commit references. Please try again later.
Commit
83eec146
authored
2 years ago
by
Lukáš Kratochvíl
Browse files
Options
Downloads
Patches
Plain Diff
feat: added Nginx
parent
14db74f3
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.env.example
+3
-0
3 additions, 0 deletions
.env.example
docker-compose.yml
+18
-0
18 additions, 0 deletions
docker-compose.yml
nginx/nginx.conf
+28
-0
28 additions, 0 deletions
nginx/nginx.conf
nginx/templates/default.conf.template
+27
-0
27 additions, 0 deletions
nginx/templates/default.conf.template
with
76 additions
and
0 deletions
.env.example
+
3
−
0
View file @
83eec146
...
...
@@ -9,5 +9,8 @@ DB_NAME=film-db
# ADMINER
ADMINER_PORT=8080
# NGINX
NGINX_PORT=3050
# CLIENT
CLIENT_PORT=3000
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
18
−
0
View file @
83eec146
...
...
@@ -50,6 +50,24 @@ services:
depends_on
:
-
postgres
nginx
:
container_name
:
nginx
image
:
nginx:1.21.6-alpine
ports
:
-
127.0.0.1:${NGINX_PORT}:${NGINX_PORT}
volumes
:
-
./nginx/templates:/etc/nginx/templates
-
./nginx/nginx.conf:/etc/nginx/nginx.conf
networks
:
-
backend-network
environment
:
-
NGINX_PORT=${NGINX_PORT}
-
SERVER_PORT=${SERVER_PORT}
restart
:
always
depends_on
:
-
server
-
postgres
client
:
container_name
:
client
image
:
client:1.0.0
...
...
This diff is collapsed.
Click to expand it.
nginx/nginx.conf
0 → 100644
+
28
−
0
View file @
83eec146
user
nginx
;
worker_processes
auto
;
error_log
/var/log/nginx/error.log
;
pid
/var/run/nginx.pid
;
events
{
worker_connections
1024
;
}
http
{
include
/etc/nginx/mime.types
;
default_type
application/octet-stream
;
log_format
main
'
$remote_addr
-
$remote_user
[
$time_local
]
"
$request
"
'
'
$status
$body_bytes_sent
"
$http_referer
"
'
'"
$http_user_agent
"
"
$http_x_forwarded_for
"'
;
# TODO: logging does not work
access_log
/var/log/nginx/access.log
;
sendfile
on
;
keepalive_timeout
65
;
# template files in /etc/nginx/templates/*.template are outputed as a result of executing envsubst to the /etc/nginx/conf.d folder
include
/etc/nginx/conf.d/*.conf
;
}
This diff is collapsed.
Click to expand it.
nginx/templates/default.conf.template
0 → 100644
+
27
−
0
View file @
83eec146
upstream nest_server {
# TODO: must be same port as the nestJS server container port
server server:3000;
}
server {
# IPv4
listen ${NGINX_PORT} default_server;
# IPv6
listen [::]:${NGINX_PORT} default_server;
location / {
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
#proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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;
proxy_pass http://nest_server;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment