Git Product home page Git Product logo

Comments (9)

buchdag avatar buchdag commented on June 9, 2024 1

I forgot to mention that you'll probably need to configure DEFAULT_HOST on the proxy too, so that request without a hostname are correctly routed to the VIRTUAL_HOST / container of your choice.

from nginx-proxy.

buchdag avatar buchdag commented on June 9, 2024 1

@buchdag From what I understand from your comment, the behavior in version 1.2.0 was a bug?

Yep. This was working without additional config because the proxy :

  • was redirecting to containers in cases where it shouldn't (no host header or unknown host).
  • was serving incorrect certificates instead of rejecting HTTPS connection when no corresponding certificates existed

from nginx-proxy.

vincent-herlemont avatar vincent-herlemont commented on June 9, 2024 1

I forgot to mention that you'll probably need to configure DEFAULT_HOST on the proxy too, so that request without a hostname are correctly routed to the VIRTUAL_HOST / container of your choice.

@buchdag Thank you, I understand better now. Actually, by adding the DEFAULT_HOST, it works perfectly, and there's no need to add the default.crt/key.

from nginx-proxy.

vincent-herlemont avatar vincent-herlemont commented on June 9, 2024

Related comment: #2186 (comment)

from nginx-proxy.

buchdag avatar buchdag commented on June 9, 2024

Hi.

Could you detail what's mounted to /etc/nginx/certs ?

Have you tried creating a default certificate / key pair ? (default.crt and default.key in /etc/nginx/certs).

from nginx-proxy.

vincent-herlemont avatar vincent-herlemont commented on June 9, 2024

@buchdag Thanks for pointing it.

Below the content of the mounted certificates

root@cb2e399bcfb0:/app# ls -lah /etc/nginx/certs/
total 28K
drwxrwxr-x 2 1001 1001 4.0K Dec 20 19:24 .
drwxr-xr-x 1 root root 4.0K Dec 20 19:25 ..
-rw-rw-r-- 1 1001 1001 1.4K Dec 20 16:35 example.com.test.crt
-rw------- 1 1001 1001 1.7K Dec 20 16:35 example.com.test.key

Have you tried creating a default certificate / key pair ? (default.crt and default.key in /etc/nginx/certs).

if I try to create default certificates:

root@cb2e399bcfb0:/app# ls -lah /etc/nginx/certs/
total 28K
drwxrwxr-x 2 1001 1001 4.0K Dec 20 19:24 .
drwxr-xr-x 1 root root 4.0K Dec 20 19:25 ..
-rw-rw-r-- 1 1001 1001 1.3K Dec 20 19:24 default.crt
-rw------- 1 1001 1001 1.7K Dec 20 19:24 default.key
-rw-rw-r-- 1 1001 1001 1.4K Dec 20 16:35 example.com.test.crt
-rw------- 1 1001 1001 1.7K Dec 20 16:35 example.com.test.key

I met the 503 nginx error.

Screenshot from 2023-12-20 20-28-49

Logs

nginx-proxy  | nginx.1     | localhost 192.168.16.1 - - [20/Dec/2023:19:29:56 +0000] "GET / HTTP/2.0" 503 592 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36" "-"

from nginx-proxy.

vincent-herlemont avatar vincent-herlemont commented on June 9, 2024

@buchdag From what I understand from your comment, the behavior in version 1.2.0 was a bug?

from nginx-proxy.

buchdag avatar buchdag commented on June 9, 2024

Glad to hear it now works for you. Could you close this issue if you consider it solved ?

from nginx-proxy.

vincent-herlemont avatar vincent-herlemont commented on June 9, 2024

Works perfectly! Thanks !

from nginx-proxy.

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.