3.5. Nginx - DNS based

This is an example of DNS based proxying with Nginx.

/etc/nginx/cond.d/OliveTin.conf
server {
    listen 443 ssl;

    ssl_certificate "/etc/nginx/conf.d/server.crt";
    ssl_certificate_key "/etc/nginx/conf.d/server.key";

    access_log  /var/log/nginx/ot.access.log  main;
    error_log /var/log/nginx/ot.error.log notice;

    server_name olivetin.example.com;

    location / {
        proxy_pass http://localhost:1337/;
        proxy_redirect http://localhost:1337/ http://localhost/OliveTin/;
    }

    location /websocket {
        proxy_set_header Upgrade "websocket";
        proxy_set_header Connection "upgrade";
        proxy_pass http://localhost:1337/websocket;
    }
}