Created
June 17, 2012 06:35
-
-
Save rjha/2943725 to your computer and use it in GitHub Desktop.
Nginx configuration for 503 custom maintenance page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
# default catch-all domain | |
server_name _ ; | |
error_page 503 @503 ; | |
#return 503 ; | |
root /var/www/htdocs/ ; | |
server_name_in_redirect off; | |
#rewrite rule for auto versioning | |
rewrite ^/(css|js)/(.*)\.t([0-9].*)\.(css|js)$ /$1/$2.$4 ; | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
location @503 { | |
#avoid redirect to built-in 503. | |
try_files /site/503.html =503; | |
} | |
location ~* \.(js|css|png|jpg|jpeg|gif)$ { | |
expires 30d ; | |
break ; | |
} | |
#pass all requests for php to fastcgi | |
location ~ \.php$ { | |
try_files $uri =404; | |
#change port on local m/c. | |
fastcgi_read_timeout 600 ; | |
fastcgi_pass 127.0.0.1:9100 ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment