• Home
  • WordPress
  • web Hosting
    • Free hosting
    • Cheap Hosting
    • comparison cloud , vps, shared, wordpress
    • managed wordpress hosting
    • managed cloud hosting
  • page Speed
  • Deals
  • Services
  • About

RAaz Kumar .com

wordpress tutorials seo hosting etc


use nginx as reverse proxy and load balancer for apache wordpress

#1 install apache server

sudo apt update & sudo apt upgrade
apt install apache2
check the webpage by typing address.
if not working.
check apache server status whether it’s  running or not.
service apache2 status.
// If any errors comment below or read apache errors

#2 change apache listening port from 80 to 8080

sudo ufw app list
apache full means both http & https 80,443 ports.
edit apache default server configuration file & change listen port from 80 to 8080
nano /etc/apache2/ports.conf
change 80 to 8080
nano /etc/apache2/sites-available/default-000.conf
change
{listen *.80 to listen ipadress.80}
<VirtualHost 127.0.0.1:8080>[…]
service apache2 reload
now webpage not works.
logging user IP address for nginx as forward proxy
etc/apache2/apache2.conf and replace %h with %{X-Forwarded-For}i:
  1. Debian ubuntu
sudo apt install libapache2-mod-rpaf
restart apache2
service apache2 restart

#2 install nginx server

apt install nginx && systemctl enable nginx.service && service nginx restart
check your ip address for live nginx server.
#2.1 edit proxy parameters
sudo nano /etc/nginx/proxy_params
proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;
Or

#2.2 edit nginx conf file

nano /etc/nginx/nginx.conf
Add in http block
proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme;  client_max_body_size 100M; client_body_buffer_size 1m; proxy_intercept_errors on; proxy_buffering on; proxy_buffer_size 128k; proxy_buffers 256 16k; proxy_busy_buffers_size 256k; proxy_temp_file_write_size 256k; proxy_max_temp_file_size 0; proxy_read_timeout 300;

#2.3 nginx server block

server {
listen:80
root /var/www/html
server_name example.com
location / {
 proxy_pass http://localhost:8080;
 include /etc/nginx/proxy_params;      }
}
including proxy params not necessary if include those in http block.
sudo service nginx reload
curl -I website.com
http 1.1 ok
server signature
benefits of using nginx as reverse proxy
#i
#1 less cpu resources & handles many connections
#2 using standalone nginx is complicated because of static module configurations
#3 we can still use apache dynamic modules strengthening security.
#4ssloffloading encrypted content from users normal http to backend server.
#5nginx caches static content & delivers better than apache due to htaccess
#load balancing if one backend server down then it sends another backend server

Using nginx as a load balancer

#applicable when 2or more backend servers are there.
We take 4backend servers
simply distributes based on conditions
which server to send this connection

load balancing Algorithms

a. round Robin algorithm (uses round Robin by default)
b. least connected: (sends least connection handling server)
c.ip hash(client ip address decides where to send connection )
to use nginx as load balancer it must be reverse proxy.
#part 1-3 setting up nginx as reverse proxy
http {  upstream crmdev {   server 192.168.101.1:8080;   server 192.168.101.2:8080;  }  server {      listen 80;      location / {          proxy_pass http://crmdev;      }  }}
#part 4use nginx as load balancer
least_conn;
ip_hash;
default weight = 1
server 192.168.101.3:8080 weight 2;
server 192.168.101.1:8080 max_fails=3 fail_timeout=30s
if 3 fails in 30seconds then server remain unavailable for 30seconds.
backup server
only gets request after 4 servers gets down.
upstream backendserver {    server 192.168.101.1:8080 max_fails=3 fail_timeout=30s;    server 192.168.101.2:8080;    server 192.168.101.3:8080 weight 2;    server 192.168.101.4:8080;    server 192.168.101.5:8080 backup;}
load balancing in wordpress while post getting updates
load balancer >>server 1 &server 2,3,4>>mysql server.
1load balancer, 2 wp sites, 1 db server.woocommerce.
each wp server shares same db server.
Blue-Green Deployment”
load balancing a e commerce website
Reverse proxy vs load balancer
reverse proxy can be load balancer.
load balancer without reverse proxy not a concept.
load balancing on single server
A load balancer distributes incoming client requests among a group of servers
It’s pointless to load balance a single server. What load balancing does is decide which server to use based on some criteria (typically load).

Related topics:

  1. enable caching in apache server (mod cache disk cache) vs fastcgi cache
  2. Lamp stack install on Ubuntu 20.4 LTS apache, mysql, php 7.4(Debian 9 & Ubuntu 18.04 lts)
  3. apache performance tuning mpm-worker vs prefork vs event modules
  4. RaazKumar.com #webhosting #wordpress #linux #nginx #apache tutorials
  5. how to enable KeepAlive connections in apache nginx wordpress

tutorials

  • Vivek Bindra Videos Transcription (business strategy)
  • git commands
  • new relic php agent install in 3 steps
  • new relic mysql install integration - 2 ways fix problems
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • Devops course Syllabus topics PDF AWS, Azure, cisco, redhat
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • how to create a website free of cost on google
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • nginx server tutorials (installation, configuration, performance tuning, security)
    • Top 10 tips to improve nginx server security
    • upgrade php fpm ubuntu nginx 7.4 to 8.2
    • install phpmyadmin ubuntu nginx 22.04
    • php fpm install ubuntu 20.04 nginx
    • nginx upstream response is buffered to a temporary file
    • php fpm ondemand vs dynamic vs Static (the dynamic pool problem)
    • Php fpm configuration for 1000 concurrent connections server busy max children reached
    • php fpm seems busy fixed warning and max children reached to handle max connections / requests
    • newrelic nginx integration process and errors fix and metrics
    • datadog nginx integration installation process
    • nginx rate limiting explained by location time specific url
    • SSL faster reduce TLS hand shake improve https performance
    • monitor nginx request with nginx status amplify datadog new relic
    • nginx installation on ubuntu 20.04 LTS
    • enable brotli compression nginx brotli vs gzip
    • nginx performance tuning
    • Letsencrypt SSL Installation on apache/Nginx ubuntu / debian wordpress
    • letsencrypt install configure on ubuntu / debian nginx
    • what is TTFB & how to Reduce it (server response time) Google pagespeed
    • php fpm restart nginx ubuntu enable status page, monitor etc
    • php fpm pool manager configuration settings based on server spike high cpu wordpress
    • nginx modules list (enable, disable, upgrade, install dynamic module)
    • nginx rewrite rules with examples 301 redirection
    • use nginx as reverse proxy and load balancer for apache wordpress
    • nginx conf explained best config file performance tuning tips nginx.conf location errors tutorial
    • nginx errors (504,502, 413, unable to start, syntax errors)
    • Pagespeed module install, configure, monitor, errors ft nginx &apache
    • Apache vs nginx (connection handling, modules, memory usage)
    • install LEMP Stack on 22.04 LTS Nginx MySQL PHP fpm #wordpress #digital ocean
    • nginx fastcgi cache wordpress how to configure
    • fix error 520 522 524 on cloudflare wordpress godaddy nginx etc
  • MySQL Tutorial (create,connect database, update tables, export etc) Documentation & TIPS
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • ubuntu tutorials installation download issues etc
  • Php tutorials
  • HTML & CSS Tutorials
  • Core Java Tutorial Free online
  • Linux sysadmin tutorials linux system administrator
  • apache server tutorial (install,config, performance tuning, security, error handling)

 

 

wordpress Pagespeed optimization

Digitalocean free $100 Credit

Cloudways Review pricing promo codes

Siteground cpu limits Pricing

Shared Hosting

Managed wordpress Hosting

Managed Hosting Cloud server

VPS Hosting

Cloud Hosting – Unmanaged

Google cloud Pricing

Aws Pricing

Azure pricing

nginx server tutorials

apache server tutorials

linux sysadmin tutorials

mysql Commands list pdf

LEMP Install Ubuntu

Mysql Performance Tuning

Nginx Performance tuning

Linux Performance tuning

Php -fpm performance tuning

Redis Performance tuning

linux server security

nginx security best practices

wordpress security plugins

 

 

wordpress

 

Top 5  WP Google Analytics Plugins

WP Backup Plugins

Wp Comment Plugins

Top wordpress Security Plugins

WP Seo Plugins

WP Caching Plugins

Best Adsense Plugins for WordPress

Wp social Sharing Plugins

autoshare social media plugins

WP speed Optimization Plugins

Speedup WordPress google Score

More Wp tuts

Server Admin Cloud

 

Installing Nginx LEMP On ubuntu

Installing apache Lamp ubuntu

nginx fastcgi cache enable

php – fpm install  & Configuration

Opcache install & Configure

php -fpm pool manager explained

Mysql Install & Configuration

Redis Object cache install & configure

 

Nginx as Reverse Proxy and Load balancer

Load Balance / auto scaling in google cloud

Linux Commands PDF

Mysql Commands Pdf

Letsencrypt tutorial

mysqldump export & import 

Pagespeed Module install & configure

nginx.conf best file

mysql.conf best file

upgrade ubuntu

© 2023 - All Rights Reserved Disclaimer & Privacy Policy