Apache / Nginx Setup
Configure Apache or Nginx to proxy your AEO blog.
If you manage your own web server (Apache or Nginx), you can configure reverse proxying at the server level. This is the most common setup for self-hosted applications, VPS servers, and traditional web hosting with server access.
How It Works
Your server proxies /blog requests to AEO. AEO identifies your brand by reading the Host header (or X-Forwarded-Host) from the incoming request. This is how we know which blog content to serve. Without the correct Host header, AEO cannot match your domain to your brand.
- Your proxy MUST forward the original Host header (or set X-Forwarded-Host). This is the most critical part of the setup.
- Your server handles SSL for your domain. AEO does not provision certificates for rewrite-mode integrations.
- Only /blog paths are proxied; all other paths on your domain continue to work normally.
Apache: Enable required modules
Apache needs three modules for HTTPS proxying. Enable them with:
sudo a2enmod proxy proxy_http ssl
sudo systemctl restart apache2On CentOS/RHEL, these modules are usually enabled by default. Check with: httpd -M | grep proxy
Apache: Add proxy configuration
Add these lines to your Apache virtual host config (or .htaccess if you don't have access to the server config):
SSLProxyEngine On
ProxyPreserveHost On
ProxyPass /blog https://aeo.how/blog
ProxyPassReverse /blog https://aeo.how/blog
ProxyPass /favicon.ico https://aeo.how/favicon.ico
ProxyPassReverse /favicon.ico https://aeo.how/favicon.ico
ProxyPass /default.png https://aeo.how/default.png
ProxyPassReverse /default.png https://aeo.how/default.png| Directive | Purpose |
|---|---|
| SSLProxyEngine On | Required because AEO uses HTTPS. |
| ProxyPreserveHost On | Forwards your domain name in the Host header so AEO can identify your brand. This is the critical line. |
| ProxyPass | Forwards matching requests to AEO. |
| ProxyPassReverse | Rewrites response headers so redirects point back to your domain. |
Nginx: Add a location block
Add this to your Nginx server block:
location /blog {
proxy_pass https://aeo.how;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_ssl_server_name on;
}
location = /favicon.ico {
proxy_pass https://aeo.how/favicon.ico;
proxy_set_header Host $host;
proxy_ssl_server_name on;
}
location = /default.png {
proxy_pass https://aeo.how/default.png;
proxy_set_header Host $host;
proxy_ssl_server_name on;
}| Directive | Purpose |
|---|---|
| proxy_set_header Host $host | Sends your domain name to AEO. |
| proxy_ssl_server_name on | Required for HTTPS proxying to work correctly with SNI. |
Restart and test
Restart your web server:
- Apache: sudo systemctl restart apache2
- Nginx: sudo nginx -t && sudo systemctl reload nginx
Visit yourdomain.com/blog to verify. Check article pages and the sitemap too.
Always test with nginx -t before reloading Nginx config. A syntax error will take your site down.
If you get a 502 Bad Gateway on Nginx, you likely need proxy_ssl_server_name on.
If you get a 500 Internal Server Error on Apache, make sure all three modules are enabled (proxy, proxy_http, ssl).