Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 Bad Gateway accesing from localhost #2432

Closed
ZJaume opened this issue Dec 17, 2019 · 4 comments
Closed

502 Bad Gateway accesing from localhost #2432

ZJaume opened this issue Dec 17, 2019 · 4 comments

Comments

@ZJaume
Copy link

ZJaume commented Dec 17, 2019

Info:

  • Docker version ($ docker --version): 19.03.5-ce, 633a0ea838
  • Laradock commit ($ git rev-parse HEAD): v9.2 d732318
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Arch Linux, kernel 5.4.2

Issue:

I'm trying to run laradock on local machine for development purposes. I'm using Caddy and Mysql and getting 502 or hang indefinitely when trying to access from the browser to 127.0.0.1. I also have tried with nginx but getting the same error. The strange thing is that exposed HTTP service is accessible outside localhost from other machines in the network, and my Laravel app is running fine from there.

Previous versions also didn't work (8.0 or 8.1)


Expected behavior:

Access to the http server with 127.0.0.1 address on the browser.


Reproduce:


Relevant Code:

0.0.0.0:80 {
    root /var/www/public
    fastcgi / php-fpm:9000 php {
        index index.php
    }

    rewrite {
        to {path} {path}/ /index.php?{query}
    }
    gzip
    browse
    log /var/log/caddy/access.log
    errors /var/log/caddy/error.log
    tls off
}

           Name                          Command               State                         Ports                       
-------------------------------------------------------------------------------------------------------------------------
laradock_caddy_1              /bin/parent caddy --conf / ...   Up      2015/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp
laradock_docker-in-docker_1   dockerd-entrypoint.sh            Up      2375/tcp, 2376/tcp                                
laradock_mysql_1              docker-entrypoint.sh mysqld      Up      0.0.0.0:3306->3306/tcp, 33060/tcp                 
laradock_php-fpm_1            docker-php-entrypoint php-fpm    Up      9000/tcp                                          
laradock_workspace_1          /sbin/my_init                    Up      0.0.0.0:2222->22/tcp

@ZJaume
Copy link
Author

ZJaume commented Jan 17, 2020

Sorry it was a problem with the VPN and iptables.

@ZJaume ZJaume closed this as completed Jan 17, 2020
@vijay-open
Copy link

@ZJaume Please add the solution. I'm also having a similar issue.

@ZJaume
Copy link
Author

ZJaume commented Jul 24, 2020

It wasn't a docker issue itself, it was my VPN program that was messsing up iptables. Disabling the VPN solved the problem.

@vijay-open
Copy link

Thanks, @ZJaume. I'm having a problem without a VPN too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants