How to redirect a domain with html extension in Nginx

A WordPress website needs to migrate to a different domain, on a new domain site use static HTML pages. On the source site, WordPress is configured to use URL like https://domain1/page-name/, on the new server, the same page available on URL https://domain2/page-name.html

To do the redirection, edit Nginx configuration for the website, on top […]

Read More…

Nginx file upload error

When uploading a file on a PHP Application running under an Nginx web server, I get the following error

The error was due to wrong ownership for folder /var/lib/nginx/tmp/client_body/ or one of its parent folders. On this web server, nginx was running as user nobody, so to fix the error, I run the following […]

Read More…

Install Nginx ModSecurity on CentOS 7

ModSecurity is a Web Application Firewall that protects your website from hacking attacks. It is Open Source and free to use. It can be used with webservers like Apache, Nginx, and IIS. To install ModSecurity with Nginx, we need to compile the ModSecurity Nginx module and activate it in the Nginx configuration file. Install the […]

Read More…

Enable SSL for icecast steam using nginx

On ubuntu server running icecast, when i try enable SSL as per CentovaCast Enable SSL on icecast, i get following error

I don’t compile my own icecast installation as it use Ubunu version of icecast, that get updated using apt. Instead of getting icecast serve steam using SSL, i installed Nginx, and proxy traffic […]

Read More…

Nginx Hotlink Protection

To block hotlink protection or bandwidth stealing, you can add following to server configuration of your web site.

If you need to allow hotlink from a specific domain, you can edit the valid_referers line and add the url. If you only want to limit access to images and videos, you can put above code […]

Read More…

Nginx Proxy Manager Certificate Key is not valid

When adding custom SSL on Nginx Proxy Manager, i get following error. Upload failed: Certificate Key is not valid (Command failed: openssl ec -in /tmp/15dbf072-4022-aee94-0f88e4fb8d86/tmp -check -noout 2>&1 ) I tried upgrading Nginx Proxy Manager to latest version with following commands

Even after the upgrade this error persist. I checked logs for the docker […]

Read More…

Nginx on Windows

You can download nginx for windows from https://nginx.org/en/download.html To download nginx from command line, use following command in PowerShell

Auto Start Nginx on Windows When using Nginx on Windows, you need to escape paths with \ like following

For SSL, i used

See Nginx […]

Read More…

Enable Nginx Status Page

Nginx status is provided by http_stub_status module. To verify if your Nginx is installed with this module, run

If the result shows “with-http_stub_status_module”, you have the module installed. To enbale stats edit nginx configuration file for your web site, add following code

To linmit access to this page, you can use allow

[…]

Read More…