How do I prevent all script execution in a web-accessible image uploads directory?

I am using nginx and PHP, and want to allow images to be uploaded by my users, and placed into a public web accessible directory. I currently have this rule defined: location ~ /uploads { location ~ \.(jpg|gif|png)$ {} deny all; } If it’s not a .jpg, .gif, or .png, then deny access to it. … Read more

error code 401 when call ping search image api

https://api.bing.microsoft.com/v7.0/images/search?Ocp-Apim-Subscription-Key=9e572eb4609e4042b490fc42b2cb004c&q=apples {“error”:{“code”:”401″,”message”:”Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.”}} Answer That key works fine if you follow the documentation. curl -H “Ocp-Apim-Subscription-Key: 9e572eb4609e4042b490fc42b2cb004c” https://api.bing.microsoft.com/v7.0/search?q=apples HTTP/1.1 200 OK … The documentation says … Read more

How do I setup Sendmail and the FQDN for use with server images

I have loadbalancer sitting infront of serveral webservers. The website served up has a contact form that uses sendmail. I have installed sendmail on one of these webservers: web-01 This is the hostname of the machine. I have gone into the /etc/hosts file and added the following: 127.0.0.1 example.com web-01 At this point the form … Read more

Does/can serving larger files (images in this case) necessitate increased CPU load on a linux/apache web server?

We are experiencing quite a high CPU load on our web server right now (I’m just doing some research, I am not actually the website’s administrator) One of the most significant changes has been a new search results page with larger thumbnail images (25 per page by default). Instead of creating a new, larger thumbnail … Read more

MODx not display correct image path

In the MODx WYSIWYG whenever I click the Image icon to insert an image, followed by browse image it generates the wrong path: /data/12/1/111/99/1111262/user/1169144/htdocs/images/image.jpg instead of assets/images/image.jpg I have checked my Resource URL and Resource Path and they both look correct. Has anyone ever experienced MODx rewriting your paths to the server vs what it … Read more

Images on SSL enabled site with Internet explorer

I have a problem with my site after implementation of SSL that images do not appear. The scenario is that images come from images.domain.com (hosted on Amazon S3) and my certificate is for www.domain.com. This problem only seems to happen in IE and not in any other browsers. Answer If the images are using that … Read more

How to efficiently permanently redirect 150.000 images?

For SEO purposes I need to rename around 150.000 images, then I’d like to permanently redirect the previous url locations requests to the new locations. The current url to every image is something like: website.com/something/unique_id/filename.jpg And I want to redirect them to: website.com/something/unique_id/new_filename.jpg I can only think about 2 options: 1) Create an enormous list … Read more

Ubuntu 13.10 server has no kernels

Something has gone wrong and now we no longer have a Linux kernel (not even recovery mode) installed. GRUB is still there, but it runs the memory test. How can I fix this? Everything I’ve looked at applies to 2010 or something silly. Answer This link should help: https://help.ubuntu.com/community/Grub2/Installing Basically, boot from a 13.10 live … Read more

Nginx : Images takes too long to load. (1sec to download a 50KB image)

I just switched from Apache to debian 7.6 nginx php-fpm and after running all kind of optimisations it seems that it takes a lot longer than usual to display images : The application is extremely fast (PHP side), I went from 1sec load time, to <500ms, the only problem are the images takes too much … Read more