Recently, I've found myself unable to upload images to this blog, and for a while I thought it was some bug in my code as a result of updating some dependencies or something.
However, after some debugging it turned out that it was the way I have my infrastructure setup. The server that hosts www.jasonernst.com runs an nginx-proxy and this blog runs behind that. I also serve a few other websites from it as well (it also makes for an easy setup with letsenrypt).
When I tried to upload a file, I was getting a `413 Request Entity Too Large`. At first I thought it was something related to gin-gonic, which this site is based on, and I increased the max size there to no effect. I then thought it might be some CORS related stuff, but nothing I tried there worked either (there have been some updates with how CORS and gin-gonic work together since I last took a look at this).
- name: Create nginx directory on host
- name: Copy nginx config to host
- name: pull and run the nginx reverse proxy
ansible_python_interpreter: "/usr/bin/env python3-docker"
(Created the directory on the host that is running the containers, added the config file defined in ansible, and then added a mapped volume from the config directory on the host into the container.
I then added a file in `conf/proxy.conf` at the same level as the task with these contents: