Skip to content

Instantly share code, notes, and snippets.

@pransteter
Last active June 18, 2020 13:48
Show Gist options
  • Save pransteter/ecd2cf37f973f93056b01cd66ac70849 to your computer and use it in GitHub Desktop.
Save pransteter/ecd2cf37f973f93056b01cd66ac70849 to your computer and use it in GitHub Desktop.
Burlar a falta de suporte do docker para resolver hosts no macOS
# Instalar nginx pelo brew:
$ brew install nginx
# Para o nginx:
$ sudo nginx -s stop
# Configurar o arquivo /usr/local/etc/nginx/nginx.conf
server {
server_name localhost;
location / {
root html;
index index.html index.htm;
}
}
# Adicionar arquivos de servidores dentro da pasta /usr/local/etc/nginx/servers conforme o template abaixo:
server {
server_name default_host;
location / {
proxy_pass http://localhost:<porta_configurada_no_container_docker>;
}
}
# Configurar o /etc/hosts:
127.0.0.1 default_host
# Iniciar novamente o nginx
$ sudo nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment