freechat/nginx-conf
2021-02-11 21:04:41 -08:00
..
freechat.conf Adding some basic configuration for Nginx as a reverse proxy 2021-02-11 20:22:53 -08:00
readme.md Nginx config notes 2021-02-11 21:04:41 -08:00
self-signed.conf Adding some basic configuration for Nginx as a reverse proxy 2021-02-11 20:22:53 -08:00
ssl-params.conf Adding some basic configuration for Nginx as a reverse proxy 2021-02-11 20:22:53 -08:00

Configs for Nginx Reverse Proxy

The above are ultra minimal configs for setting up nginx.

For self signing

I'll be using openssl and summarizing the Digital OCean tutorial. Reference

  1. First you will have to generate a self-signed key and certificate pair.
openssl req -x509 -nodes -days 365 -newkey:2048 -keyout /etc/ssl/private/freechat.key -out /etc/ssl/certs/freechat.crt
  1. Next create the Diffie-Hellman group file:
openssl dhparam -out /detc/ssl/certs/freechat.pem 2048
  1. Next we should setup the configs for Nginx
  • Place self-signed.conf into /etc/nginx/snippets.

This file tells nginx to use the previously created self signed certificates.

  • Place ssl-params.conf into /etc/nginx/snippets.

This file is pretty general so if you're not self signing you can still use it as just configures TLS and SSL for Nginx.

  1. After that you should be ready to start the server.

Final Notes

Keep in mind will be able to access json-api endpoints with https://domain.net: and without the port number attached. If you wish to restrict then I suggest restricting clients to force the port number as all clients should be configured to do so anyway.

Suggestions?

If something here seems wrong or needs fixing/updating/correcting feel free to open an issue.