Closed frankroc2022 closed 2 years ago
You get the "bad gateway" message when trying to reach the Devilbox GUI or a specific site?
Are you able to open up the vhosts.php page?
You get the "bad gateway" message when trying to reach the Devilbox GUI or a specific site?
Are you able to open up the vhosts.php page?
Yes
Are you able to open up the vhosts.php page?
Yes
Can you dump the vhost configuration here. Maybe there is something wrong with the override. You find it on the vhosts.php page
#
#
#
#
#
#
vhost: | server { listen PORT__HTTP_PROTO__DEFAULT_VHOST__; server_name VHOST_NAME__;
access_log "__ACCESS_LOG__" combined;
error_log "__ERROR_LOG__" warn;
# Reverse Proxy definition (Ensure to adjust the port, currently '8000')
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://php:4000;
}
REDIRECT SSL ALIASES DENIES __SERVER_STATUS__
CUSTOM }
vhost_type: docroot: "" rproxy: ""
features:
ssl: | ssl_certificate SSL_PATH_CRT; ssl_certificate_key SSL_PATH_KEY; ssl_protocols SSL_PROTOCOLS__; ssl_prefer_server_ciphers SSL_HONOR_CIPHER_ORDER; ssl_ciphers __SSL_CIPHERS;
redirect: | return 301 https://__VHOST_NAME__:__SSL_PORT__$request_uri;
php_fpm: ""
alias: |
location ~ __ALIAS__ {
root __PATH__;
__XDOMAIN_REQ__
}
deny: |
location ~ __REGEX__ {
deny all;
}
server_status: |
location ~ __REGEX__ {
stub_status on;
access_log off;
}
xdomain_request: |
if ( $http_origin ~* (__REGEX__) ) {
add_header "Access-Control-Allow-Origin" "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
add_header 'Access-Control-Max-Age' 0;
return 200;
}
Can you reproduce the bug?
Any new information?
Can you reproduce the bug?
Or anyone else? Am I the only one with this problem?
in the Devilbox, can you do the following and provide the output?
curl -I http://php:4000
Thx for reply/help.
In PHP Container: (right?) curl: (7) Failed to connect to php port 4000: Connection refused
@frankroc2022 Which port is your service running? Maybe run the service and then run the curl command.
Port 4000 like described in the example: https://devilbox.readthedocs.io/en/latest/examples/setup-reverse-proxy-nodejs.html
curl: (7) Failed to connect to php port 4000: Connection refused
@vikas5914 It works for you?
@frankroc2022 The port should be where your Nodejs is running. If it's running on 8080 or 8000, you need to use that.
Thx, here was my mistake: I changed
NODE_PROJECTS=( "/shared/httpd/my-node/js/index.js" )
to NODE_PROJECTS=( "/shared/httpd/my-node/index.js" <-- it has to be /shared/httpd/my-node/src/index.js )
@frankroc2022 if it's fixed, I suggest you close the issue.
@frankroc2022
This has now been automated: https://github.com/cytopia/devilbox/pull/942
Have you already looked into this bug?
(Optional) Error message
502 Bad Gateway nginx/1.21.6
What went wrong?
502 Bad Gateway nginx/1.21.6
Expected behaviour
Hello World to read.
How can we reproduce the bug?
Install Devilbox under Ubutu 22.04 setup auto dns and ssl and follow https://devilbox.readthedocs.io/en/latest/examples/setup-reverse-proxy-nodejs.html
I changed
NODE_PROJECTS=( "/shared/httpd/my-node/js/index.js" )
to NODE_PROJECTS=( "/shared/httpd/my-node/index.js" )
Host Operating System
Linux
Host Platform (amd64, arm64, other)
amd64
(Linux only) Is SELinux enabled?
No, SELinux is disabled
Docker version
Docker version 20.10.12, build 20.10.12-0ubuntu4
Docker Compose version
docker-compose version 1.29.2, build unknown
Devilbox version
Devilbox v2.2.0 (2022-04-14)
Have you removed stopped containers before starting?
Yes
Have you pulled latest Docker images before starting?
Yes
Devilbox start command
docker-compose up httpd php bind
Config: .env file
Config: docker-compose.override.yml
No response
Config: ./check-config.sh
Log: docker-compose logs
(Optional) Additional information
No response