Welcome to the blog

HTTP to HTTPS Nginx

There are 2 methods to redirect to https in Nginx 1st method is to create a separate server block for port 80 and redirect all to https. server { listen 80; //ipv4 listen [::]:80; //ipv6 server_name example.com; return 301 https://$host$request_uri;}2nd method is to add a…

Continue reading...

How to add nginx geoip module in ubuntu

First add the nginx stable repo: sudo add-apt-repository ppa:nginx/stableThen run apt update: sudo apt-get updateAnd get the nginx geoip module: sudo apt-get install nginx-module-geoipThis will download and load the module to /usr/lib/nginx/modules To load the nginx module, open nginx.conf: sudo nano /etc/nginx/nginx.confadd add below in…

Continue reading...