Skip to content
Snippets Groups Projects
Commit eaaf50cd authored by Henrik's avatar Henrik
Browse files

fix: fix 20

parent 23c644a9
No related branches found
No related tags found
1 merge request!91Feat/deployment
Pipeline #283855 passed
...@@ -9,5 +9,6 @@ RUN npm run build ...@@ -9,5 +9,6 @@ RUN npm run build
# Step 2: Setup the server with Nginx # Step 2: Setup the server with Nginx
FROM nginx:stable-alpine as production-stage FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY web/nginx.conf /etc/nginx/nginx.conf
EXPOSE 5173 EXPOSE 5173
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
# Frontend server configuration worker_processes auto;
server {
listen 443 ssl;
server_name sparesti.org; # Main domain for the frontend
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; error_log /var/log/nginx/error.log notice;
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; pid /var/run/nginx.pid;
location / { events {
proxy_pass http://vue-frontend:80; # Adjust the port and container name as necessary worker_connections 1024;
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;
}
} }
# API server configuration http {
server { include /etc/nginx/mime.types;
listen 443 ssl;
server_name api.sparesti.org; # API subdomain
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt; server {
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key; listen 5173;
server_name localhost;
location / { location / {
proxy_pass http://spring-backend:8080; # Adjust the port and container name as necessary root /usr/share/nginx/html;
proxy_set_header Host $host; try_files $uri $uri/ /index.html;
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;
} }
}
# HTTP to HTTPS redirection for main domain and subdomain
server {
listen 80;
server_name sparesti.org api.sparesti.org;
return 301 https://$host$request_uri;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment