Giter Site home page Giter Site logo

Comments (6)

tiredofit avatar tiredofit commented on July 21, 2024

Because you are overwriting the default.conf file in /etc/nginx/conf.d likely -
the STAGE command isn't really useful in that image other than to me, but it wont hurt to have it set.

The ./logs/nginx/error.log should also give a clue as to whats happening.

from docker-nginx-php-fpm.

perarg avatar perarg commented on July 21, 2024

Because you are overwriting the default.conf file in /etc/nginx/conf.d

I wanted to have a control to some kind of modifications in the feature. But I didn't change anything there. I haven't previously created any folder there, so the conf.d/ is a mirror of the container's folder.

The ./logs/nginx/error.log should also give a clue as to whats happening.

That's a weird thing. access.log and error.log are both empty.

I notice that there is no location / { } directive in nginx.conf file. Is it relative to the issue?

from docker-nginx-php-fpm.

tiredofit avatar tiredofit commented on July 21, 2024

Strange, I can't seem to recreate it even doing what you are doing with the conf.d folder. I think this is probably a good opportunity to add some custom script functionality into the image. I'm quite busy right now but will put it on the list to support some sort of "snippets" function.

Hows about when you head inside the container and type curl localhost

from docker-nginx-php-fpm.

perarg avatar perarg commented on July 21, 2024

Hows about when you head inside the container and type curl localhost

Connection refused at port 80

But...
i tried commenting the line # - ./nginx_conf.d:/etc/nginx/conf.d and it worked.

I noticed that when i try to link the folder /etc/nginx/conf.d with a host folder (./nginx_conf.d) these two folders are empty. Why this is happening ??

The two other volumes (html and logs) are created at the container's creation time and they contain the files existed inside the container. But this is not happening with the /etc/nginx/conf.d folder. It is empty only when i try to mount it.

from docker-nginx-php-fpm.

tiredofit avatar tiredofit commented on July 21, 2024

I have a couple of files in nginx/conf.d - the biggest one that matters would be the default.conf file - I'm guessing if you are mapping it, and the folder is empty outside the container, it's overwriting the inside of it which is killing the config.

I have to figure out a way to be able to load additional configs for you - I agree this is not the best way forward, but I rarely if ever do something with this image other than serve basic apps, more so using it as a springboard to build other images.

On one of my other images I expanded on this and had a "conf.available" folder that let me use and insert certain templates, although it was very specific for the application. I'll need to think about this on how to implement without mucking too many things up.

At the very least you could in the meantime get a copy of the nginx/conf.d/default.conf from the working image, copy it out, make your changes to it and then mount the folder ./conf.d:/etc/nginx/conf.d:ro for the time being. The image won't fail per say just won't edit any of the files properly, I've done that a few times in a pinch.

from docker-nginx-php-fpm.

perarg avatar perarg commented on July 21, 2024

At the very least you could in the meantime get a copy of the nginx/conf.d/default.conf from the working image, copy it out, make your changes to it and then mount the folder ./conf.d:/etc/nginx/conf.d:ro for the time being

That's how i did it and it is indeed a working path.

from docker-nginx-php-fpm.

Related Issues (20)

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.