Link Search Menu Expand Document

Create the proxy server on Digital Ocean

You can create as many server blocks in this config file as you want, only to define proxy_pass where this would be your upstream destination.

proxy_cache_path /tmp/cache/zone_2 levels=1:2 keys_zone=proxy_zone_origin.example.com:100m max_size=1g inactive=60m use_temp_path=off; 
#max_size=1g sets the upper limit of the size of the cache 1 gigabytes.
proxy_cache_key $scheme$request_method$host$request_uri$http_x_custom_header$http_cookie;

server {
    server_name origin.example.com;

    location / {
        include proxy_params;
        proxy_pass http://192.25.25.0; 
        # Insert your AWS IP. 
        proxy_cache proxy_zone_origin.example.com; 
        proxy_cache_valid any 5m; 

        add_header reserve-proxy-cache $upstream_cache_status; 
        add_header reserve-proxy-cached-on $upstream_http_Date;
        add_header Set-Cookie "Path=/; HttpOnly; Secure";
    }

        listen 443 ssl http2;
        ssl_certificate /etc/letsencrypt/live/origin.example.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/origin.example.com/privkey.pem;
        ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

        access_log /var/log/nginx/proxy-simple-access.log;
        error_log /var/log/nginx/proxy-simple-error.log;
}