Last active
June 18, 2020 13:48
-
-
Save pransteter/ecd2cf37f973f93056b01cd66ac70849 to your computer and use it in GitHub Desktop.
Burlar a falta de suporte do docker para resolver hosts no macOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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