Skip to content

Instantly share code, notes, and snippets.

@wrick17
Created October 12, 2019 08:10
Show Gist options
  • Save wrick17/482ac0e3411387076676cfefadd7feeb to your computer and use it in GitHub Desktop.
Save wrick17/482ac0e3411387076676cfefadd7feeb to your computer and use it in GitHub Desktop.
# Local ngnix server for mac to have subroutes to your localhost domain
# With this, if you hit http://localhost/food, it'll load localhost:8580 on that route.
# /usr/local/etc/nginx/nginx.conf
http {
server {
listen 80;
server_name localhost;
location /food/ {
rewrite ^/food/?(.*)$ /$1 break;
proxy_pass 'http://localhost:8480/';
}
location /blog/ {
rewrite ^/blog/?(.*)$ /$1 break;
proxy_pass 'http://localhost:8580/';
}
}
}
events {
worker_connections 1024;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment