Last active
August 29, 2015 14:02
-
-
Save nomaster/56abb5286f87997cb484 to your computer and use it in GitHub Desktop.
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
Normalise your URLs! | |
Bad | |
/opt/db/functions.php&session=5698136136 | |
/forum.php?user=21515&group=134&mode=table | |
Good | |
/blog/2014/05/big-news | |
/articles/UGF1056-digital-camera | |
/users/alice/photos/fF96UXd | |
Assets? | |
<script src="/js/all.js"></script> | |
<link rel="stylesheet" src="//cdn.example.com/styles-1415.min.css"/> // look ma: no protocol! | |
<img src="/photos/fF96UXd.jpg" type="image/jpeg"/> | |
Router functionality | |
### Nginx configuration | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment