Last active
January 21, 2017 04:40
-
-
Save miguelramos/a2060295525a48ccc3dc to your computer and use it in GitHub Desktop.
Nginx Grav
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
server { | |
listen 80; | |
server_name *.grav.dev; | |
root /home/www/grav.dev; | |
index index.html index.htm index.php; | |
charset utf-8; | |
location /user { | |
rewrite ^/user/accounts/(.*)$ /error redirect; | |
rewrite ^/user/config/(.*)$ /error redirect; | |
rewrite ^/user/(.*)\.(txt|md|html|php|yaml|json|twig|sh|bat)$ /error redirect; | |
} | |
location /cache { | |
rewrite ^/cache/(.*) /error redirect; | |
} | |
location /bin { | |
rewrite ^/bin/(.*)$ /error redirect; | |
} | |
location /system { | |
rewrite ^/system/(.*)$ /error redirect; | |
} | |
location /vendor { | |
rewrite ^/vendor/(.*)$ /error redirect; | |
} | |
# Remember to change 127.0.0.1:9000 to the Ip/port | |
# you configured php-cgi.exe to run from | |
access_log off; | |
error_log /var/log/nginx/grav-error.log error; | |
sendfile off; | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
#fastcgi_pass 127.0.0.1:9000; | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment