Skip to content

Instantly share code, notes, and snippets.

Created June 22, 2017 21:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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