MerginMaps / server

Mergin Maps: Store and track changes to your geo-data. Public repository for enterprise and community edition.
https://merginmaps.com
138 stars 47 forks source link

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

Open digitalbirth opened 10 months ago

digitalbirth commented 10 months ago

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
MarcelGeo commented 4 months ago

@digitalbirth feel free to open PR to this enhancement