Setting up Nginx Reverse Proxy for VPS with Cloudways, Cloudflare, and MediaWiki
Introduction
This article explains how to set up an Nginx reverse proxy to connect a VPS server with MediaWiki, Cloudflare, and Cloudways. The Nginx reverse proxy will act as a middleman, forwarding requests from Cloudflare to the VPS server hosting the MediaWiki installation.
Prerequisites
- VPS Server: A virtual private server (VPS) is required to host the MediaWiki installation.
- Cloudways: Cloudways is a managed cloud hosting platform that simplifies the process of managing servers.
- Cloudflare: Cloudflare is a content delivery network (CDN) and DNS service that provides security and performance benefits.
- MediaWiki: MediaWiki is the open-source wiki software powering Wikipedia and other wiki projects.
Steps to Set Up Nginx Reverse Proxy
- Install Nginx on Cloudways: Log in to your Cloudways account, navigate to the server settings, and install Nginx if it's not already installed.
- Configure Nginx: Edit the Nginx configuration file (usually located at /etc/nginx/nginx.conf or /etc/nginx/conf.d/default.conf) and add the following reverse proxy settings:
server {
listen 80;
server_name your_domain.com;
location / {
proxy_pass http://your_vps_ip:80;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
By setting up an Nginx reverse proxy, you can connect your VPS server with MediaWiki, Cloudflare, and Cloudways, ensuring a secure and high-performance setup for your wiki project.
References
- Book: "Linux Networking Cookbook" by Sander van Vugt
- Article: "How to Set Up Nginx Reverse Proxy on Ubuntu 18.04" by DigitalOcean
- Online Resource: "Setting up MediaWiki with Cloudflare and Cloudways" by Cloudways Support