1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-13 21:52:29 +01:00
polr/.nginx-config
2014-12-04 14:49:41 -05:00

34 lines
988 B
Plaintext

# =========================
# Polr nginx redirect rules
# http://github.com/cydrobolt/polr
# Add this file to your nginx configuration at /etc/nginx/conf.d/
# Please note that this configuration is experimental,
# and may have issues.
# =========================
server {
listen 80;
server_name %SERVER_NAME%;
root /app;
index index.php;
location / {
if (!-e $request_filename) {
rewrite ^/([a-zA-Z0-9]+)\?([a-zA-Z0-9]+)$ /r.php?u=$1&lkey=$2;
}
rewrite ^/([a-zA-Z0-9]+)/?$ /r.php?u=$1;
rewrite ^/?\+([a-zA-Z0-9]+)$ /stats.php?bv=$1;
}
location /t {
rewrite ^/t-([a-zA-Z0-9]+)/?$ /r.php?u=t-$1;
}
location /api {
rewrite ^(.*)$ /api.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}