Skip to content

Instantly share code, notes, and snippets.

@1isten
Last active February 1, 2021 15:59
Show Gist options
  • Save 1isten/e4cdd9383f7601b568e10adcd720d682 to your computer and use it in GitHub Desktop.
Save 1isten/e4cdd9383f7601b568e10adcd720d682 to your computer and use it in GitHub Desktop.
Homebrew nginx (Valet version) with custom config:

In /usr/local/etc/nginx/nginx.conf (default config), Valet has included these lines:

# ...

    include "/Users/sten/.config/valet/Nginx/*";
    include servers/*; # 👈
    include valet/valet.conf;

# ...

so:

mkdir -p /usr/local/share/nginx
cd /usr/local/share/nginx
ln -sfv /usr/local/var/www html

mkdir -p /usr/local/etc/nginx/servers
cd /usr/local/etc/nginx/servers
touch static 3030to3000
@1isten
Copy link
Author

1isten commented Jan 28, 2021

/usr/local/etc/nginx/servers/3030to3000:

server {
  listen 3030;
  server_name localhost;

  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:3000;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment