1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-09-19 15:11:40 +02:00
polr/.nginx-config
2015-10-21 13:57:56 +02:00

35 lines
991 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;
}
}