Skip to content

Feature Request: Add error.log and access.log to Nginx #156

@digitalbirth

Description

@digitalbirth

To help assist others in troubleshooting their installations, it may help to make it easy to enable logging for the nginx server.

It should be commented out by default so the logs don't grow in size, but should be an easy option to enable if required.

nginx.conf

Add lines:
" #access_log /var/log/nginx/access.log;
#error_log /var/log/nginx/error.log warn; "

server {
   listen 80;
   listen [::]:80;
   server_name _;

   client_max_body_size 4G;

  # Logs - uncomment to enable location:/mergin/logs
  # If enabled be aware of disk space used by the logs.
   #access_log /var/log/nginx/access.log;
   #error_log /var/log/nginx/error.log warn;

docker-compose.yml

add line:
" - ./logs:/var/log/nginx/"

proxy:
    image: nginx
    container_name: merginmaps-proxy
    restart: always
    ports:
      - "8080:80"
    volumes:
      - ./projects:/data  # map data dir to host
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
      - ./logs:/var/log/nginx/  # map logs dir to host

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions