I wish to use nginx as a lightweight URL shortener.
To be exact, assuming my domain name is example.com
, I have this most basic nginx.conf
:
events {}
http {
server {
listen 80;
location = /vimrc {
proxy_pass https://some/publicly/available/url/to/vimrc;
}
... # similar locations follow
}
}
So, whenever I wish to deploy my vim configuration, I can simply do: curl example.com/vimrc
.
This seems to be working as intended, although with almost zero knowledge of nginx, I am a little concerned of default nginx behavior (which I am not aware of) that may expose my server to security related threats.
It should be noted I currently don't mind running on port 80. (I am well aware of mitm, and that the connection is in plaintext, but this is not something I wish to deal with at the moment).
Update
- I've modified the configuration to use
return 301 https://url/to/vimrc
. - I will probably look into Configuring SSL as well, as the small chance of MITM is indeed not worth the risk.