Giter Site home page Giter Site logo

Comments (2)

flashspys avatar flashspys commented on August 21, 2024 1

Hey,
thanks for using this image!

The default nginx.conf in this image disables the access.log. Please add a modfied version to your image similar to the process of adding a custom default.conf. The path, where the nginx.conf is located, is /etc/nginx/nginx.conf

from docker-nginx-static.

InCogNiTo124 avatar InCogNiTo124 commented on August 21, 2024 1

Thanks for help @flashspys. I will explain my solution for anyone in the future:

I made a file default.conf with this content:

server {
    listen       80;
    server_name  localhost;
    location / {
        root   /static;
        index  index.html index.htm;
    }
    access_log /dev/stdout;
    error_log /dev/stderr;
}

You can basically copy/paste this.

Then, I made one simple change in my docker-compose.yml

services:
  my-service:
    image: ...
    labels: ... # traefik v2 stuff
    ports: ...
    volumes:
      - ./default.conf:/etc/nginx/conf.d/default.conf

This works automagically, and sudo docker logs returns proper logs now.

from docker-nginx-static.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.