Skip to main content

Nginx rewrite rule examples

Redirect to url with slash

Some CMS for sites may open pages with a slash at the end, and without it, if the engine does not redirect itself. For example, the page http://example.net/page and http://example.net/page/ from the point of view of the visitor will be one. But for search engines, these are two different pages, and slash is to blame for everything. So duplicate content is bad.

(Further…)

How to create a self-signed certificate

Create a self-signed certificate with two commands. It may be useful to administer the site via https, for example.

1. Create a key.

  # openssl genrsa -out server.key 2048 

2. Create a certificate. The domain example.com should be replaced with yours.

  # openssl req -new -x509 -key server.key -out server.crt -days 3650 -subj /CN=example.com