Skip to content

Commit

Permalink
Add nginx.conf
Browse files Browse the repository at this point in the history
Add nginx configuration example for rewrite rules.

Closes #12.
  • Loading branch information
Rutger Laurman authored and mathiasbynens committed Feb 4, 2017
1 parent bd49941 commit f64ee34
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}

}

0 comments on commit f64ee34

Please sign in to comment.