Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Nginx Proxy for Maintenance Page hosted on S3
server {
listen 80 default_server;
listen [::]:80 default_server;
# SSL Optional
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate /etc/ssl/my_cert.pem;
ssl_certificate_key /etc/ssl/my_cert.key;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
proxy_intercept_errors on;
error_page 403 404 500 502 503 @s3error;
proxy_set_header Authorization "";
# Capture asset requests
location ~ .*/maintenance-page-files/(.*)$ {
# Capture all requests
location / {
set $indexfile "";
proxy_pass http://$indexfile;
# Redirect to Nginx error page instead of S3 error page
location @s3error {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.