diff --git a/Dockerfile b/Dockerfile index 4f366ac..cd9747c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,8 @@ COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/node_modules /app/node_modules COPY --from=build /app/server /app/server COPY --from=build /app/package.json /app/package.json -COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY nginx.conf /etc/nginx/nginx.conf +RUN rm -f /etc/nginx/conf.d/default.conf EXPOSE 80 diff --git a/nginx.conf b/nginx.conf index 4bbf100..0378f5a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,61 +1,76 @@ -server { - listen 80; - server_name localhost; - gzip on; +worker_processes auto; +pid /tmp/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + sendfile on; + tcp_nopush on; + keepalive_timeout 65; + + gzip on; gzip_comp_level 6; gzip_vary on; - gzip_types text/plain text/css application/json application/x-javascript application/javascript text/xml application/xml application/rss+xml text/javascript image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/rss+xml image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype; - # SSR routes (search bots + guests get real HTML) - location ~ ^/(explore|routes|sitemap\.xml|robots\.txt)$ { - proxy_pass http://127.0.0.1:3001; - 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 Cookie $http_cookie; - } + server { + listen 80; + server_name localhost; - # Public workout detail — SSR - location ~ ^/public/workouts/ { - proxy_pass http://127.0.0.1:3001; - 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 Cookie $http_cookie; - } - - # Landing page: SSR if no auth cookie, SPA if has token - location = / { - hascookie token .; - if ($cookie_token = "") { + # SSR routes (search bots + guests get real HTML) + location ~ ^/(explore|routes|sitemap\.xml|robots\.txt)$ { proxy_pass http://127.0.0.1:3001; 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 Cookie $http_cookie; } - # If cookie present → fall through to static (SPA handles redirect) - root /usr/share/nginx/html; - try_files /index.html =404; - } - # Everything else → SPA - location / { - root /usr/share/nginx/html; - try_files $uri /index.html; - } + # Public workout detail — SSR + location ~ ^/public/workouts/ { + proxy_pass http://127.0.0.1:3001; + 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 Cookie $http_cookie; + } - # Static assets - location /assets/ { - root /usr/share/nginx/html; - expires 30d; - add_header Cache-Control "public, immutable"; - } + # Landing page: SSR if no auth cookie, SPA if has token + location = / { + hascookie token .; + if ($cookie_token = "") { + proxy_pass http://127.0.0.1:3001; + proxy_set_header Host $host; + proxy_set_header Cookie $http_cookie; + } + root /usr/share/nginx/html; + try_files /index.html =404; + } - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } + # Everything else → SPA + location / { + root /usr/share/nginx/html; + try_files $uri /index.html; + } - location ~ /\. { - deny all; + # Static assets + location /assets/ { + root /usr/share/nginx/html; + expires 30d; + add_header Cache-Control "public, immutable"; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + location ~ /\. { + deny all; + } } } diff --git a/src/pages/workouts/components/WorkoutListItem.vue b/src/pages/workouts/components/WorkoutListItem.vue index 7ec6853..ecb8ee2 100644 --- a/src/pages/workouts/components/WorkoutListItem.vue +++ b/src/pages/workouts/components/WorkoutListItem.vue @@ -16,7 +16,6 @@ Дата: {{ formatTime(item.workouted_at) }}