sudo service nginx restart
sudo service php-fpm restart
sudo service php-fpm restart
server {
listen 80;
server_name www.foo.bar;
location / {
allow my.public.ip.here;
deny all;
}
}
You can have multiple "allow" lines.
http://stackoverflow.com/questions/8438867/how-can-i-allow-access-to-a-single-ip-address-via-nginx-conf
server {
server_name example.com www.example.com;
rewrite ^/moodle/(.*\.php)(/)(.*)$ /moodle/$1?file=/$3 last;
In the same file, in the php section:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
Putting the same rewrite rule in the location /moodle section does not work.
If you are using the cpXstack plugin for cPanel, make sure you follow this:
For any domain that has nginX+PHP-FPM enabled, additional nginX configuration can be added by the root user at
Changes made any where else may not be preserved during server shut down.