# If you want to use your domain example.com in HTTPS mode (with SSL),
# rename this file to ssl.example.com.conf (from ssl.example.com.conf.HTTPS)
# Replace example.com with your domain name.
# Make sure you have your SSL certificate installed properly.
# The certificate files are not required to be in the directories presented here, but
# the path must be the correct path to your certificate files.
# The webserver on your antlet will listen on port 80 (http).
# Nginx on edgeLinux handles SSL (https).
# Redirect http://www.example.com to https://example.com
# If your domain name does include 'www' then remove this server block and use the full
# domain name in the last server block.
server_name www.example.com;
rewrite ^ https://example.com$request_uri redirect;
# Redirect http://... to https://...
rewrite ^ https://example.com$request_uri redirect;
# Redirect https://www... to https://example.com
# If your domain name does include 'www' then remove this server block and use the full
# domain name in the last server block.
ssl_certificate /etc/ssl/certs/mycerts/example.com.crt;
ssl_certificate_key /etc/ssl/certs/mycerts/example.com.key;
server_name www.example.com;
rewrite ^ $scheme://example.com$request_uri redirect;
# Think of the word 'example' in 'upstream example' as a variable name which is
# used in other server blocks. This name must be unique among all your .conf
# files. It is used in the two 'proxy_pass' lines in the next server block.
# If you change the upstream variable name then be sure to update the proxy_pass
# Enter the IP address and port number of your antlet handling this domain
ssl_certificate /etc/ssl/certs/mycerts/example.com.crt;
ssl_certificate_key /etc/ssl/certs/mycerts/example.com.key;
proxy_connect_timeout 300;
proxy_busy_buffers_size 256k;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Ssl off;
proxy_set_header X-Url-Scheme $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://example;
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf|woff|woff2)(\?.*)?$ {
add_header Cache-Control "public, max-age=315360000";
proxy_connect_timeout 300;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header X-Forwarded-Ssl off;
proxy_set_header X-Url-Scheme $scheme;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_pass http://example;