Comments (9)
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 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.
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.
Related comment: #2186 (comment)
from nginx-proxy.
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.
@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.
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.
@buchdag From what I understand from your comment, the behavior in version 1.2.0
was a bug?
from nginx-proxy.
Glad to hear it now works for you. Could you close this issue if you consider it solved ?
from nginx-proxy.
Works perfectly! Thanks !
from nginx-proxy.
Related Issues (20)
- Unable to download python requirements for testing HOT 1
- default.conf config file formatting corrupted and hardly readable (nginx -T) HOT 1
- Issue with Bookstack urls being re-written to http not https HOT 2
- 403 Forbidden error when serving static site HOT 1
- Cannot reach container in IPv6 network HOT 4
- "daemon" directive is duplicate in /etc/nginx/nginx.conf error HOT 3
- connect() failed (111: Connection refused) while connecting to upstream HOT 2
- vhost.d for http part
- 502 Bad Gateway & Upstream connection refused HOT 7
- host header does not include port number HOT 2
- `nginx-proxy` pass converting `%1C` to pipe `|` HOT 1
- 405 (cors error) on specific location
- The server connection via port 443 fails when using PHP 8.1 or above HOT 2
- Error 500 On Service Start
- htpasswd folder doesn't work anymore / no basic auth HOT 1
- Can't get .conf.template files to work with env variables/file. HOT 2
- Custom HTTP return code instead of 503
- Is it possible to use it in Spring Boot?
- nginx-proxy fails with nginx: [emerg] duplicate location "/.well-known/acme-challenge/" in /etc/nginx/vhost.d/default:2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-proxy.