Enabling SSL for Sendgrid clickthrough links on WPEngine

290 Views Asked by At

We need the last step completed for Sendgrid to be able to create the SSL.

Steps are: Using a Proxy

To prepare your account for SSL for click and open tracking using a proxy, please follow the following steps:

Prepare a proxy (like a web application, NGINX, or Amazon API Gateway) to take all traffic for mailing.example.com and forward it to http://sendgrid.net or https://sendgrid.net.
Set up the proxy to use HTTP or HTTPS. For HTTPS, provide a valid SSL certificate for mailing.example.com domain.
To forward traffic, set the Host HTTP header to mailing.example.com domain.
Point the CNAME record to your proxy. For example, CNAME mailing.example.com proxy.example.com.

In the steps above, mailing.example.com will need to be replaced with your actual link branding, and proxy.example.com will be replaced with your proxy.

WPEngine ref: https://wpengine.com/support/using-a-reverse-proxy-with-wp-engine/

QUESTION: What RULE needs to be created in order to supply it to our host WP Engine?

Thanks for any help you may provide.

Edit:

Tried this server rule in the nginx config:

  server {
    server_name mailing.example.com;
    listen 80;
    listen [::]:80;
        location / {
        proxy_pass http://sendgrid.net;
        proxy_set_header Host mailing.example.com;
    }
  }
  server {
    server_name mailing.example.com;
    listen 443 ssl;
    listen [::]:443 ssl;
    ssl_certificate /etc/nginx/ssl/fullchain.pem;
    ssl_certificate_key /etc/nginx/ssl/privkey.pem;
    location / {
        proxy_pass https://sendgrid.net;
        proxy_set_header Host mailing.example.com;
    }
  }

ERROR - When saving the rule to NGINX: nginx-before did not save. Error: server" directive is not allowed here.

0

There are 0 best solutions below