Fix nginx logging configuration for statistics
- Create log directory in Dockerfile - Add proper logging configuration to default.conf - Mount logs directory in docker-compose.yml for persistence - Fixes 502 error caused by missing log directory
This commit is contained in:
parent
3e1892a6f7
commit
e3930cf87a
3 changed files with 8 additions and 2 deletions
|
|
@ -18,11 +18,12 @@ RUN pnpm build
|
|||
# Production image
|
||||
FROM nginx:alpine AS runner
|
||||
|
||||
# Create required directories
|
||||
# Create required directories for web content and logs
|
||||
RUN mkdir -p /usr/share/nginx/html/images/thumbnails \
|
||||
/usr/share/nginx/html/subtitles \
|
||||
/usr/share/nginx/html/transcriptions \
|
||||
/usr/share/nginx/html/videos
|
||||
/usr/share/nginx/html/videos \
|
||||
/var/log/nginx/deafgain-website
|
||||
|
||||
# Copy built app and static assets
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ server {
|
|||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Logging configuration for statistics
|
||||
access_log /var/log/nginx/deafgain-website/access.log combined;
|
||||
error_log /var/log/nginx/deafgain-website/error.log error;
|
||||
|
||||
# Security headers
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ services:
|
|||
restart: unless-stopped
|
||||
volumes:
|
||||
- /docker/websites/deafgain/video_content:/usr/share/nginx/html/videos
|
||||
- /docker/websites/deafgain/logs:/var/log/nginx/deafgain-website
|
||||
networks:
|
||||
- caddy_network
|
||||
- default
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue