Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Create A New nginx Server On A Mac

TODO: Fix the formatting of this post that got busted during the move to nextjs

Setting up an nginx server ==========================

Code

Create a config file under:

    /usr/local/etc/nginx/servers


Make it look something like this:

    server {
        listen       80;
        server_name  legendary.react_scratchpad;

        #access_log  logs/host.access.log  main;

        location / {
            root   /Users/alans/dev/react_scratchpad;
            index  index.html;
        }

        error_page  404              /404.html;
        error_page   500 502 503 504  /50x.html;
    }
    


Then start and stop nginx with:

    sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
    sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.nginx.plist