init
This commit is contained in:
0
nginx/.gitkeep
Normal file
0
nginx/.gitkeep
Normal file
7
nginx/Dockerfile
Normal file
7
nginx/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM nginx:1.23.2-alpine
|
||||
|
||||
RUN mkdir -p /usr/share/nginx/html/static/frontend
|
||||
##COPY index.html /usr/share/nginx/html/static/frontend/.
|
||||
COPY ./default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
|
||||
39
nginx/default (copie).conf
Normal file
39
nginx/default (copie).conf
Normal file
@@ -0,0 +1,39 @@
|
||||
upstream django {
|
||||
server backend-django:8001;
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
#listen [::]:80;
|
||||
server_name localhost;
|
||||
|
||||
proxy_read_timeout 7200;
|
||||
proxy_connect_timeout 7200;
|
||||
proxy_send_timeout 7200;
|
||||
|
||||
# backend-django #1
|
||||
location ^~ /staticfiles/ {
|
||||
alias staticfiles/;
|
||||
}
|
||||
|
||||
|
||||
# backend-django #2
|
||||
location ~ ^/(api|accounts|admin)/? {
|
||||
proxy_pass http://django;
|
||||
proxy_set_header Host $host;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# frontend-react
|
||||
location / {
|
||||
root /usr/share/nginx/html/static/frontend;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
gzip on;
|
||||
gzip_comp_level 3;
|
||||
gzip_vary on;
|
||||
gzip_types application/javascript application/json application/xml image/bmp image/jpeg image/gif image/png image/svg+xml text/css text/html text/plain;
|
||||
}
|
||||
}
|
||||
39
nginx/default.conf
Normal file
39
nginx/default.conf
Normal file
@@ -0,0 +1,39 @@
|
||||
upstream django {
|
||||
server backend-django:8001;
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
|
||||
listen 80;
|
||||
#listen [::]:80;
|
||||
server_name localhost;
|
||||
|
||||
proxy_read_timeout 7200;
|
||||
proxy_connect_timeout 7200;
|
||||
proxy_send_timeout 7200;
|
||||
|
||||
# backend-django #1
|
||||
location ^~ /staticfiles/ {
|
||||
alias staticfiles/;
|
||||
}
|
||||
|
||||
|
||||
# backend-django #2
|
||||
location ~ ^/(api|accounts|admin)/? {
|
||||
proxy_pass http://django;
|
||||
proxy_set_header Host $host;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
# frontend-react
|
||||
location / {
|
||||
root /usr/share/nginx/html/static/frontend;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
gzip on;
|
||||
gzip_comp_level 3;
|
||||
gzip_vary on;
|
||||
gzip_types application/javascript application/json application/xml image/bmp image/jpeg image/gif image/png image/svg+xml text/css text/html text/plain;
|
||||
}
|
||||
}
|
||||
2
nginx/index.html
Normal file
2
nginx/index.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<html>
|
||||
<body>ceci est une page de test</body></html>
|
||||
Reference in New Issue
Block a user