fixed problems for depployment

This commit is contained in:
2024-04-24 15:50:43 +00:00
parent e592aa33cb
commit 31eb15f006
20 changed files with 254 additions and 124 deletions

8
proxy/Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
# nginx/Dockerfile
FROM nginx:1.23.3-alpine
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
EXPOSE 443

42
proxy/nginx.conf Normal file
View File

@@ -0,0 +1,42 @@
# nginx/nginx.conf
events {
}
http {
upstream front {
server front:3000;
}
server {
# Redirect HTTP requests to HTTPS.
listen 80;
server_name localhost;
root /srv/public;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name localhost;
root /srv/public;
server_tokens off;
ssl_certificate /etc/nginx/ssl/cert.pem;
ssl_certificate_key /etc/nginx/ssl/privkey.pem;
location / {
try_files $uri $uri/ @front;
}
location @front {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-Ssl on;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://front;
proxy_cookie_path / "/; HTTPOnly; Secure";
}
}
}