This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This server demo does a socket hijack in Rack and then saves the socket to a global variable | |
# to prevent it from being GCed when the Puma thread ends. It will then write "BEEP" to each | |
# socket every ten seconds to prevent the connection timing out. During testing, it easily | |
# handled up to 65523 connections, after which it ran into the `ulimit` for open file descriptors. | |
# The bit with the waiting area is there because a normal `Set` is not thread safe and it would | |
# drop socket due to race conditions. The `Queue` is thread safe and will make sure all sockets | |
# are preserved. | |
# run with `rackup -q -p 8000 -o 0.0.0.0 c10k.ru` | |
# testing: install `ab` and then run `ab -c 20000 -n 20000 <ip adress of server>:8000/ |