From f64ee342246fa5bf0340641372680a2d398afc79 Mon Sep 17 00:00:00 2001 From: Rutger Laurman Date: Sat, 4 Feb 2017 13:22:46 +0100 Subject: [PATCH] Add nginx.conf Add nginx configuration example for rewrite rules. Closes #12. --- nginx.conf | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 nginx.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..756a3cb --- /dev/null +++ b/nginx.conf @@ -0,0 +1,27 @@ +server { + + # Match this with your setup + listen 80; + server_name _; + + root /var/www/html; + index index.php; + + # START rewrite rules + location /shorten { + try_files $uri $uri/ /shorten.php?$args; + } + + location / { + rewrite ^/(.*)$ /index.php?slug=$1 last; + try_files $uri $uri/ /index.php; + } + # END rewrite rules + + # Match this with your setup + location ~ \.php$ { + include snippets/fastcgi-php.conf; + fastcgi_pass unix:/run/php/php7.0-fpm.sock; + } + +}