Created
May 14, 2013 14:45
-
-
Save anonymous/5576488 to your computer and use it in GitHub Desktop.
Nginx Rewrite Rules for Sendy - AWS Nginx and php-fpm
This file contains hidden or 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
# | |
# Nginx rewrite rules for Sendy (http://sendy.co) | |
# PHP-FPM | |
# | |
# http://sendy.co/forum/discussion/142/nginx-rewrite-rule | |
# | |
server { | |
listen 80; | |
server_name sendy.pisosecarpetes.com.br; | |
access_log /usr/share/nginx/html/sendy/logs/access.log; | |
error_log /usr/share/nginx/html/sendy/error.log; | |
root /usr/share/nginx/sendy; | |
index index.php index.html; | |
location / { | |
index index.php; | |
if (!-f $request_filename){ | |
rewrite ^/([a-zA-Z0-9-]+)$ /$1.php last; | |
} | |
} | |
location /l/ { | |
rewrite ^/l/([a-zA-Z0-9/]+)$ /l.php?i=$1 last; | |
} | |
location /t/ { | |
rewrite ^/t/([a-zA-Z0-9/]+)$ /t.php?i=$1 last; | |
} | |
location /w/ { | |
rewrite ^/w/([a-zA-Z0-9/]+)$ /w.php?i=$1 last; | |
} | |
location /unsubscribe/ { | |
rewrite ^/unsubscribe/(.*)$ /unsubscribe.php?i=$1 last; | |
} | |
location /subscribe/ { | |
rewrite ^/subscribe/(.*)$ /subscribe.php?i=$1 last; | |
} | |
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ { | |
expires max; | |
log_not_found off; | |
} | |
location ~ \.php$ { | |
#if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss | |
expires off; #nao usar cache pra php (dinamico) | |
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/sendy$fastcgi_script_name; | |
include fastcgi_params; | |
fastcgi_read_timeout 1200; | |
send_timeout 1200; | |
proxy_read_timeout 1200; | |
keepalive_timeout 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment